version: '3.8' services: # PostgreSQL Database postgres: image: postgres:16-alpine environment: POSTGRES_USER: consistencyforge POSTGRES_PASSWORD: consistencyforge POSTGRES_DB: consistencyforge ports: - "5432:5432" volumes: - postgres_data:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U consistencyforge"] interval: 5s timeout: 5s retries: 5 restart: unless-stopped # Redis (for Celery and caching) redis: image: redis:7-alpine ports: - "6379:6379" healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 5s timeout: 5s retries: 5 restart: unless-stopped # Backend API backend: build: context: ./backend dockerfile: Dockerfile ports: - "8000:8000" environment: DATABASE_URL: postgresql+asyncpg://consistencyforge:consistencyforge@postgres:5432/consistencyforge JWT_SECRET: super-secret-jwt-key-change-in-production REDIS_URL: redis://redis:6379/0 CELERY_BROKER_URL: redis://redis:6379/1 CELERY_RESULT_BACKEND: redis://redis:6379/2 DEBUG: "false" CORS_ORIGINS: http://localhost:5173,http://localhost:3000,http://localhost depends_on: postgres: condition: service_healthy redis: condition: service_healthy restart: unless-stopped # Celery Worker celery_worker: build: context: ./backend dockerfile: Dockerfile command: celery -A app.celery_app worker --loglevel=info environment: DATABASE_URL: postgresql+asyncpg://consistencyforge:consistencyforge@postgres:5432/consistencyforge REDIS_URL: redis://redis:6379/0 CELERY_BROKER_URL: redis://redis:6379/1 CELERY_RESULT_BACKEND: redis://redis:6379/2 depends_on: postgres: condition: service_healthy redis: condition: service_healthy restart: unless-stopped # Frontend (Nginx) frontend: build: context: ./frontend dockerfile: Dockerfile ports: - "80:80" depends_on: - backend restart: unless-stopped volumes: postgres_data: