version: '3.8' services: game-server: build: . container_name: fftcg-server restart: unless-stopped ports: - "3000:3000" # REST API - "3001:3001" # WebSocket environment: - NODE_ENV=production - DATABASE_URL=postgresql://postgres:${POSTGRES_PASSWORD:-fftcg_secret}@db:5432/fftcg - JWT_SECRET=${JWT_SECRET:-change-this-in-production} - SMTP_HOST=${SMTP_HOST:-smtp.gmail.com} - SMTP_PORT=${SMTP_PORT:-587} - SMTP_USER=${SMTP_USER:-} - SMTP_PASS=${SMTP_PASS:-} - SMTP_FROM=${SMTP_FROM:-noreply@fftcg.local} - APP_URL=${APP_URL:-http://localhost:3000} depends_on: db: condition: service_healthy healthcheck: test: ["CMD", "curl", "-f", "http://localhost:3000/health"] interval: 30s timeout: 10s retries: 3 db: image: postgres:15-alpine container_name: fftcg-db restart: unless-stopped volumes: - postgres_data:/var/lib/postgresql/data environment: - POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-fftcg_secret} - POSTGRES_DB=fftcg healthcheck: test: ["CMD-SHELL", "pg_isready -U postgres"] interval: 10s timeout: 5s retries: 5 # Uncomment to expose DB port for external access (debugging) # ports: # - "5432:5432" volumes: postgres_data: # Optional: Add pgAdmin for database management # Uncomment the following to enable # # pgadmin: # image: dpage/pgadmin4 # container_name: fftcg-pgadmin # restart: unless-stopped # ports: # - "5050:80" # environment: # - PGADMIN_DEFAULT_EMAIL=admin@fftcg.local # - PGADMIN_DEFAULT_PASSWORD=admin # depends_on: # - db