version: '3.8' services: postgres: image: postgres:16-alpine environment: POSTGRES_DB: polybot POSTGRES_USER: polybot POSTGRES_PASSWORD: ${DB_PASSWORD:-botpass} volumes: - pgdata:/var/lib/postgresql/data ports: - '5432:5432' healthcheck: test: ['CMD-SHELL', 'pg_isready -U polybot -d polybot'] interval: 10s timeout: 5s retries: 5 redis: image: redis:7-alpine ports: - '6379:6379' volumes: - redisdata:/data healthcheck: test: ['CMD', 'redis-cli', 'ping'] interval: 10s timeout: 5s retries: 5 bot: build: context: . target: bot env_file: .env environment: DATABASE_URL: postgresql://polybot:${DB_PASSWORD:-botpass}@postgres:5432/polybot REDIS_URL: redis://redis:6379 ports: - '${BOT_HEALTH_PORT:-3001}:3001' depends_on: postgres: condition: service_healthy redis: condition: service_healthy restart: unless-stopped dashboard: build: context: . target: dashboard env_file: .env environment: DATABASE_URL: postgresql://polybot:${DB_PASSWORD:-botpass}@postgres:5432/polybot REDIS_URL: redis://redis:6379 ports: - '${DASHBOARD_PORT:-3000}:3000' depends_on: postgres: condition: service_healthy restart: unless-stopped volumes: pgdata: redisdata: