| version: '3.8' | |
| services: | |
| web: | |
| build: | |
| context: . | |
| dockerfile: Dockerfile | |
| args: | |
| - NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL:-http://localhost:8000} | |
| - NEXT_PUBLIC_APP_URL=${NEXT_PUBLIC_APP_URL:-http://localhost:3000} | |
| - NEXT_PUBLIC_WS_URL=${NEXT_PUBLIC_WS_URL:-ws://localhost:8000} | |
| container_name: backgroundfx-web | |
| ports: | |
| - "3000:3000" | |
| environment: | |
| - NODE_ENV=production | |
| - NEXTAUTH_URL=${NEXTAUTH_URL:-http://localhost:3000} | |
| - NEXTAUTH_SECRET=${NEXTAUTH_SECRET} | |
| - DATABASE_URL=${DATABASE_URL} | |
| - REDIS_URL=${REDIS_URL:-redis://redis:6379} | |
| depends_on: | |
| - redis | |
| networks: | |
| - backgroundfx-network | |
| restart: unless-stopped | |
| healthcheck: | |
| test: ["CMD", "curl", "-f", "http://localhost:3000/api/health"] | |
| interval: 30s | |
| timeout: 10s | |
| retries: 3 | |
| start_period: 40s | |
| redis: | |
| image: redis:7-alpine | |
| container_name: backgroundfx-redis | |
| ports: | |
| - "6379:6379" | |
| volumes: | |
| - redis-data:/data | |
| networks: | |
| - backgroundfx-network | |
| restart: unless-stopped | |
| command: redis-server --appendonly yes | |
| healthcheck: | |
| test: ["CMD", "redis-cli", "ping"] | |
| interval: 10s | |
| timeout: 5s | |
| retries: 5 | |
| nginx: | |
| image: nginx:alpine | |
| container_name: backgroundfx-nginx | |
| ports: | |
| - "80:80" | |
| - "443:443" | |
| volumes: | |
| - ./nginx.conf:/etc/nginx/nginx.conf:ro | |
| - ./ssl:/etc/nginx/ssl:ro | |
| - nginx-cache:/var/cache/nginx | |
| depends_on: | |
| - web | |
| networks: | |
| - backgroundfx-network | |
| restart: unless-stopped | |
| healthcheck: | |
| test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost/health"] | |
| interval: 30s | |
| timeout: 10s | |
| retries: 3 | |
| volumes: | |
| redis-data: | |
| nginx-cache: | |
| networks: | |
| backgroundfx-network: | |
| driver: bridge |