# GallerySubscriber - Production Docker Compose # # Quick Start: # 1. Copy .env.example to .env and configure required values # 2. Run: docker compose up -d # 3. Access the web UI at http://localhost:8080 # # For development, see docker-compose.dev.yml services: # Combined backend API + frontend static files app: image: git.fabledsword.com/bvandeusen/gallerysubscriber:latest ports: - "${PORT:-8080}:8080" environment: - TZ=${TZ:-America/New_York} - DATABASE_URL=postgresql://${DB_USER:-gdl}:${DB_PASSWORD}@${DB_HOST:-db}:${DB_PORT:-5432}/${DB_NAME:-gallery_subscriber} - REDIS_URL=redis://${REDIS_HOST:-redis}:${REDIS_PORT:-6379}/${REDIS_DB:-0} - SECRET_KEY=${SECRET_KEY} - DOWNLOAD_PARALLEL_LIMIT=${DOWNLOAD_PARALLEL_LIMIT:-3} - DOWNLOAD_RATE_LIMIT=${DOWNLOAD_RATE_LIMIT:-3.0} - LOG_LEVEL=${LOG_LEVEL:-INFO} volumes: - ${DATA_DOWNLOADS:-downloads}:/data/downloads - ${DATA_CONFIG:-config}:/data/config depends_on: db: condition: service_healthy redis: condition: service_started restart: unless-stopped # Celery download workers - only process download tasks (heavy work) worker: image: git.fabledsword.com/bvandeusen/gallerysubscriber:latest command: celery -A app.tasks.celery_app worker --queues=downloads --loglevel=info environment: - TZ=${TZ:-America/New_York} - DATABASE_URL=postgresql://${DB_USER:-gdl}:${DB_PASSWORD}@${DB_HOST:-db}:${DB_PORT:-5432}/${DB_NAME:-gallery_subscriber} - REDIS_URL=redis://${REDIS_HOST:-redis}:${REDIS_PORT:-6379}/${REDIS_DB:-0} - SECRET_KEY=${SECRET_KEY} - DOWNLOAD_PARALLEL_LIMIT=${DOWNLOAD_PARALLEL_LIMIT:-3} - DOWNLOAD_RATE_LIMIT=${DOWNLOAD_RATE_LIMIT:-3.0} - LOG_LEVEL=${LOG_LEVEL:-INFO} volumes: - ${DATA_DOWNLOADS:-downloads}:/data/downloads - ${DATA_CONFIG:-config}:/data/config depends_on: db: condition: service_healthy redis: condition: service_started restart: unless-stopped # Celery scheduler - runs beat + handles lightweight scheduling tasks scheduler: image: git.fabledsword.com/bvandeusen/gallerysubscriber:latest command: celery -A app.tasks.celery_app worker --queues=scheduling --beat --loglevel=info --concurrency=1 environment: - TZ=${TZ:-America/New_York} - DATABASE_URL=postgresql://${DB_USER:-gdl}:${DB_PASSWORD}@${DB_HOST:-db}:${DB_PORT:-5432}/${DB_NAME:-gallery_subscriber} - REDIS_URL=redis://${REDIS_HOST:-redis}:${REDIS_PORT:-6379}/${REDIS_DB:-0} - SECRET_KEY=${SECRET_KEY} depends_on: db: condition: service_healthy redis: condition: service_started restart: unless-stopped # PostgreSQL database db: image: postgres:15-alpine environment: - TZ=${TZ:-America/New_York} - POSTGRES_USER=${DB_USER:-gdl} - POSTGRES_PASSWORD=${DB_PASSWORD} - POSTGRES_DB=${DB_NAME:-gallery_subscriber} volumes: - postgres_data:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-gdl} -d ${DB_NAME:-gallery_subscriber}"] interval: 5s timeout: 5s retries: 5 restart: unless-stopped # Redis for Celery task queue redis: image: redis:7-alpine restart: unless-stopped volumes: postgres_data: downloads: config: