services: postgres: image: postgres:15-alpine container_name: vpk_postgres environment: POSTGRES_USER: ${POSTGRES_USER} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} POSTGRES_DB: ${POSTGRES_DB} volumes: - postgres_data:/var/lib/postgresql/data - ./backups/postgres:/backups restart: unless-stopped healthcheck: test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"] interval: 30s timeout: 10s retries: 5 redis: image: redis:7-alpine container_name: vpk_redis restart: unless-stopped healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 30s timeout: 10s retries: 5 backend: build: context: ./backend dockerfile: Dockerfile container_name: vpk_backend volumes: - ./app/data:/app/data - ./logs:/app/logs environment: DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB} REDIS_URL: redis://redis:6379/0 SECRET_KEY: ${SECRET_KEY} SETTINGS_ENCRYPTION_KEY: ${SETTINGS_ENCRYPTION_KEY} BACKEND_CORS_ORIGINS: ${BACKEND_CORS_ORIGINS} ENVIRONMENT: production restart: unless-stopped depends_on: postgres: condition: service_healthy redis: condition: service_healthy celery_worker: build: context: ./backend dockerfile: Dockerfile container_name: vpk_celery_worker volumes: - ./app/data:/app/data - ./logs:/app/logs environment: DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB} REDIS_URL: redis://redis:6379/0 SECRET_KEY: ${SECRET_KEY} SETTINGS_ENCRYPTION_KEY: ${SETTINGS_ENCRYPTION_KEY} ENVIRONMENT: production restart: unless-stopped depends_on: postgres: condition: service_healthy redis: condition: service_healthy command: celery -A app.core.celery_app worker --loglevel=info frontend: build: context: ./frontend dockerfile: Dockerfile args: NEXT_PUBLIC_API_URL: ${NEXT_PUBLIC_API_URL} container_name: vpk_frontend restart: unless-stopped depends_on: - backend nginx: image: nginx:alpine container_name: vpk_nginx ports: - "80:80" - "443:443" volumes: - ./docker/nginx/nginx.prod.conf:/etc/nginx/nginx.conf:ro - ./docker/nginx/templates:/etc/nginx/templates:ro - ./docker/certs:/etc/nginx/certs:ro restart: unless-stopped depends_on: - backend - frontend volumes: postgres_data: app_data: