version: '3.8' services: # Redis for Celery redis: image: redis:7-alpine ports: - "6379:6379" volumes: - redis_data:/data healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 10s timeout: 5s retries: 5 # Web application (Frontend + Backend) web: build: . ports: - "5000:5000" environment: - FLASK_ENV=production - SECRET_KEY=${SECRET_KEY:-change-me-in-production} - JWT_SECRET_KEY=${JWT_SECRET_KEY:-change-jwt-secret} - ENCRYPTION_KEY=${ENCRYPTION_KEY:-change-encryption-key} - DATABASE_URL=sqlite:///instance/prod.db - CELERY_BROKER_URL=redis://redis:6379/0 - CELERY_RESULT_BACKEND=redis://redis:6379/1 volumes: - ./data/uploads:/app/uploads - ./data/reports:/app/reports - ./data/instance:/app/instance depends_on: redis: condition: service_healthy # Celery worker worker: build: . command: celery -A celery_worker.celery worker --loglevel=info environment: - FLASK_ENV=production - SECRET_KEY=${SECRET_KEY:-change-me-in-production} - JWT_SECRET_KEY=${JWT_SECRET_KEY:-change-jwt-secret} - ENCRYPTION_KEY=${ENCRYPTION_KEY:-change-encryption-key} - DATABASE_URL=sqlite:///instance/prod.db - CELERY_BROKER_URL=redis://redis:6379/0 - CELERY_RESULT_BACKEND=redis://redis:6379/1 volumes: - ./data/uploads:/app/uploads - ./data/reports:/app/reports - ./data/instance:/app/instance depends_on: redis: condition: service_healthy volumes: redis_data: