Self-Hosting
Deploy spritesynth on your own infrastructure with Docker, PostgreSQL, Redis, and RunPod.
Overview
Deploy spritesynth on your own infrastructure. The platform requires PHP 8.3+, a PostgreSQL database, Redis for caching and queues, and S3-compatible storage for assets.
Requirements
| Component | Version | Purpose |
|---|---|---|
| PHP | 8.3+ | Application runtime |
| PostgreSQL | 15+ | Primary database |
| Redis | 7+ | Cache, queues, sessions |
| S3-compatible storage | — | Asset storage (MinIO, AWS S3, Cloudflare R2) |
| RunPod | — | GPU inference for AI generation |
Docker Compose Setup
The fastest way to get started is with Docker Compose.
1. Clone and configure
git clone https://github.com/spritesynth/spritesynth.git
cd spritesynth
cp .env.example .env2. Configure environment variables
Edit .env with your settings:
APP_NAME=SpriteSynth
APP_URL=https://your-domain.com
APP_KEY=base64:your-generated-key
DB_CONNECTION=pgsql
DB_HOST=postgres
DB_PORT=5432
DB_DATABASE=spritesynth
DB_USERNAME=spritesynth
DB_PASSWORD=your-db-password
REDIS_HOST=redis
REDIS_PORT=6379
AWS_ACCESS_KEY_ID=your-s3-key
AWS_SECRET_ACCESS_KEY=your-s3-secret
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=spritesynth-assets
AWS_ENDPOINT=https://your-s3-endpoint.com
RUNPOD_API_KEY=your-runpod-api-key
RUNPOD_ENDPOINT_ID=your-runpod-endpoint-id3. Start services
docker compose up -d
docker compose exec app php artisan migrate --force
docker compose exec app php artisan db:seed4. Access the application
Open https://your-domain.com in your browser.
Environment Variables
Application
| Variable | Description |
|---|---|
APP_NAME | Application name |
APP_URL | Application URL |
APP_KEY | Encryption key (generate with php artisan key:generate) |
APP_ENV | Environment: local, staging, production |
APP_DEBUG | Debug mode: true or false |
Database
| Variable | Description |
|---|---|
DB_CONNECTION | Database driver (pgsql recommended) |
DB_HOST | Database host |
DB_PORT | Database port (default: 5432) |
DB_DATABASE | Database name |
DB_USERNAME | Database user |
DB_PASSWORD | Database password |
Redis
| Variable | Description |
|---|---|
REDIS_HOST | Redis host |
REDIS_PORT | Redis port (default: 6379) |
REDIS_PASSWORD | Redis password (if required) |
S3 Storage
| Variable | Description |
|---|---|
AWS_ACCESS_KEY_ID | S3 access key |
AWS_SECRET_ACCESS_KEY | S3 secret key |
AWS_DEFAULT_REGION | S3 region |
AWS_BUCKET | S3 bucket name |
AWS_ENDPOINT | S3 endpoint URL (for MinIO, R2, etc.) |
AWS_USE_PATH_STYLE_ENDPOINT | Set to true for MinIO |
RunPod (GPU Inference)
| Variable | Description |
|---|---|
RUNPOD_API_KEY | RunPod API key |
RUNPOD_ENDPOINT_ID | RunPod serverless endpoint ID |
RunPod Configuration
RunPod provides the GPU infrastructure for AI generation. Set up a serverless endpoint:
- Create a RunPod account at runpod.io
- Deploy a serverless endpoint with the spritesynth GPU template
- Copy the API key and endpoint ID into your
.envfile
Endpoint Setup
# Test your RunPod connection
docker compose exec app php artisan runpod:testQueue Workers
Start Horizon for queue processing:
docker compose exec app php artisan horizonIn production, run Horizon as a supervised process or use the included systemd configuration.
Production Checklist
- Set
APP_ENV=productionandAPP_DEBUG=false - Generate a strong
APP_KEY - Configure HTTPS (reverse proxy with nginx/Caddy)
- Set up database backups
- Configure Redis persistence
- Set up S3 bucket with proper permissions
- Configure RunPod endpoint and test inference
- Run
php artisan config:cacheandphp artisan route:cache - Set up monitoring and logging
Updating
git pull origin main
docker compose exec app composer install --no-dev
docker compose exec app php artisan migrate --force
docker compose exec app php artisan config:cache
docker compose exec app php artisan route:cache
docker compose restartNeed help?
Join our Discord community for support and tips.
Was this page helpful?