- Create frontend-sba/.env.example and frontend-pd/.env.example templates - Fix hardcoded allowedHosts in nuxt.config.ts (now reads NUXT_ALLOWED_HOSTS) - Add NUXT_ALLOWED_HOSTS support to frontend-pd/nuxt.config.ts - Update docker-compose.yml with missing env vars: - FRONTEND_URL, DISCORD_SERVER_REDIRECT_URI - ALLOWED_DISCORD_IDS, WS_HEARTBEAT_INTERVAL, WS_CONNECTION_TIMEOUT - NUXT_ALLOWED_HOSTS for both frontends - Create docker-compose.prod.yml for production overrides - Update root .env.example with new variables - Add "Multi-Domain Deployment" section to README.md with checklist - Update all CLAUDE.md files with environment configuration docs - Remove obsolete 'version' attribute from docker-compose files 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
132 lines
3.7 KiB
YAML
132 lines
3.7 KiB
YAML
# Paper Dynasty Game Engine - Full Stack Orchestration
|
|
# Use this for integration testing, demos, or when you want everything containerized
|
|
# For daily dev, see README.md for local development workflow
|
|
|
|
services:
|
|
# Redis cache (shared dependency)
|
|
redis:
|
|
image: redis:7-alpine
|
|
ports:
|
|
- "6379:6379"
|
|
volumes:
|
|
- redis_data:/data
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 5s
|
|
timeout: 3s
|
|
retries: 5
|
|
|
|
# FastAPI Game Backend
|
|
backend:
|
|
build:
|
|
context: ./backend
|
|
dockerfile: Dockerfile
|
|
ports:
|
|
- "8000:8000"
|
|
environment:
|
|
# Application
|
|
- APP_ENV=development
|
|
- DEBUG=true
|
|
- SECRET_KEY=${SECRET_KEY:-dev-secret-key-change-in-production}
|
|
|
|
# Database (using host machine's PostgreSQL)
|
|
- DATABASE_URL=${DATABASE_URL}
|
|
|
|
# Redis
|
|
- REDIS_URL=redis://redis:6379
|
|
|
|
# Discord OAuth
|
|
- DISCORD_CLIENT_ID=${DISCORD_CLIENT_ID}
|
|
- DISCORD_CLIENT_SECRET=${DISCORD_CLIENT_SECRET}
|
|
- DISCORD_REDIRECT_URI=${DISCORD_REDIRECT_URI:-http://localhost:3000/auth/callback}
|
|
|
|
# League APIs
|
|
- SBA_API_URL=${SBA_API_URL}
|
|
- SBA_API_KEY=${SBA_API_KEY}
|
|
- PD_API_URL=${PD_API_URL}
|
|
- PD_API_KEY=${PD_API_KEY}
|
|
|
|
# CORS
|
|
- CORS_ORIGINS=http://localhost:3000,http://localhost:3001
|
|
|
|
# Server-side OAuth
|
|
- FRONTEND_URL=${FRONTEND_URL:-http://localhost:3000}
|
|
- DISCORD_SERVER_REDIRECT_URI=${DISCORD_SERVER_REDIRECT_URI:-http://localhost:8000/api/auth/discord/callback/server}
|
|
|
|
# Access Control
|
|
- ALLOWED_DISCORD_IDS=${ALLOWED_DISCORD_IDS:-}
|
|
|
|
# WebSocket Settings
|
|
- WS_HEARTBEAT_INTERVAL=${WS_HEARTBEAT_INTERVAL:-30}
|
|
- WS_CONNECTION_TIMEOUT=${WS_CONNECTION_TIMEOUT:-60}
|
|
depends_on:
|
|
redis:
|
|
condition: service_healthy
|
|
volumes:
|
|
# Mount source code for hot-reload during development
|
|
- ./backend/app:/app/app:ro
|
|
- ./backend/logs:/app/logs
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:8000/api/health"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
# SBA League Frontend
|
|
frontend-sba:
|
|
build:
|
|
context: ./frontend-sba
|
|
dockerfile: Dockerfile
|
|
ports:
|
|
- "3000:3000"
|
|
environment:
|
|
- NUXT_PUBLIC_LEAGUE_ID=sba
|
|
- NUXT_PUBLIC_LEAGUE_NAME=Stratomatic Baseball Association
|
|
- NUXT_PUBLIC_API_URL=http://localhost:8000
|
|
- NUXT_PUBLIC_WS_URL=http://localhost:8000
|
|
- NUXT_PUBLIC_DISCORD_CLIENT_ID=${DISCORD_CLIENT_ID}
|
|
- NUXT_PUBLIC_DISCORD_REDIRECT_URI=http://localhost:3000/auth/callback
|
|
- NUXT_ALLOWED_HOSTS=${NUXT_ALLOWED_HOSTS:-localhost,127.0.0.1}
|
|
depends_on:
|
|
backend:
|
|
condition: service_healthy
|
|
volumes:
|
|
# Mount source for hot-reload
|
|
- ./frontend-sba:/app
|
|
- /app/node_modules
|
|
- /app/.nuxt
|
|
restart: unless-stopped
|
|
|
|
# PD League Frontend
|
|
frontend-pd:
|
|
build:
|
|
context: ./frontend-pd
|
|
dockerfile: Dockerfile
|
|
ports:
|
|
- "3001:3001"
|
|
environment:
|
|
- NUXT_PUBLIC_LEAGUE_ID=pd
|
|
- NUXT_PUBLIC_LEAGUE_NAME=Paper Dynasty
|
|
- NUXT_PUBLIC_API_URL=http://localhost:8000
|
|
- NUXT_PUBLIC_WS_URL=http://localhost:8000
|
|
- NUXT_PUBLIC_DISCORD_CLIENT_ID=${DISCORD_CLIENT_ID}
|
|
- NUXT_PUBLIC_DISCORD_REDIRECT_URI=http://localhost:3001/auth/callback
|
|
- NUXT_ALLOWED_HOSTS=${NUXT_ALLOWED_HOSTS:-localhost,127.0.0.1}
|
|
depends_on:
|
|
backend:
|
|
condition: service_healthy
|
|
volumes:
|
|
# Mount source for hot-reload
|
|
- ./frontend-pd:/app
|
|
- /app/node_modules
|
|
- /app/.nuxt
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
redis_data:
|
|
|
|
networks:
|
|
default:
|
|
name: paperdynasty-network |