S
spritesynthDOCS

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

ComponentVersionPurpose
PHP8.3+Application runtime
PostgreSQL15+Primary database
Redis7+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 .env

2. 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-id

3. Start services

docker compose up -d
docker compose exec app php artisan migrate --force
docker compose exec app php artisan db:seed

4. Access the application

Open https://your-domain.com in your browser.

Environment Variables

Application

VariableDescription
APP_NAMEApplication name
APP_URLApplication URL
APP_KEYEncryption key (generate with php artisan key:generate)
APP_ENVEnvironment: local, staging, production
APP_DEBUGDebug mode: true or false

Database

VariableDescription
DB_CONNECTIONDatabase driver (pgsql recommended)
DB_HOSTDatabase host
DB_PORTDatabase port (default: 5432)
DB_DATABASEDatabase name
DB_USERNAMEDatabase user
DB_PASSWORDDatabase password

Redis

VariableDescription
REDIS_HOSTRedis host
REDIS_PORTRedis port (default: 6379)
REDIS_PASSWORDRedis password (if required)

S3 Storage

VariableDescription
AWS_ACCESS_KEY_IDS3 access key
AWS_SECRET_ACCESS_KEYS3 secret key
AWS_DEFAULT_REGIONS3 region
AWS_BUCKETS3 bucket name
AWS_ENDPOINTS3 endpoint URL (for MinIO, R2, etc.)
AWS_USE_PATH_STYLE_ENDPOINTSet to true for MinIO

RunPod (GPU Inference)

VariableDescription
RUNPOD_API_KEYRunPod API key
RUNPOD_ENDPOINT_IDRunPod serverless endpoint ID

RunPod Configuration

RunPod provides the GPU infrastructure for AI generation. Set up a serverless endpoint:

  1. Create a RunPod account at runpod.io
  2. Deploy a serverless endpoint with the spritesynth GPU template
  3. Copy the API key and endpoint ID into your .env file

Endpoint Setup

# Test your RunPod connection
docker compose exec app php artisan runpod:test

Queue Workers

Start Horizon for queue processing:

docker compose exec app php artisan horizon

In production, run Horizon as a supervised process or use the included systemd configuration.

Production Checklist

  • Set APP_ENV=production and APP_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:cache and php 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 restart

Need help?

Join our Discord community for support and tips.
Was this page helpful?

On this page