version: '3.8' services: postgres: image: postgres:16-alpine container_name: simfleet-postgres environment: POSTGRES_DB: simfleet POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres volumes: - postgres_data:/var/lib/postgresql/data - ./backend/scripts/init-timescaledb.sql:/docker-entrypoint-initdb.d/init-timescaledb.sql ports: - "5432:5432" healthcheck: test: ["CMD-SHELL", "pg_isready -U postgres"] interval: 10s timeout: 5s retries: 5 redis: image: redis:7-alpine container_name: simfleet-redis ports: - "6379:6379" volumes: - redis_data:/data healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 10s timeout: 5s retries: 5 backend: build: context: ./backend dockerfile: Dockerfile container_name: simfleet-backend environment: DATABASE_URL: postgresql+asyncpg://postgres:postgres@postgres:5432/simfleet REDIS_URL: redis://redis:6379/0 CELERY_BROKER_URL: redis://redis:6379/1 CELERY_RESULT_BACKEND: redis://redis:6379/2 SECRET_KEY: your-secret-key-change-in-production DEBUG: "true" CORS_ORIGINS: '["http://localhost:5173","http://localhost:3000"]' OPENAI_API_KEY: ${OPENAI_API_KEY} ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY} ports: - "8000:8000" depends_on: postgres: condition: service_healthy redis: condition: service_healthy volumes: - ./backend:/app command: uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload frontend: build: context: ./frontend dockerfile: Dockerfile container_name: simfleet-frontend ports: - "5173:80" depends_on: - backend environment: VITE_API_URL: http://localhost:8000/api/v1 celery-worker: build: context: ./backend dockerfile: Dockerfile container_name: simfleet-celery-worker environment: DATABASE_URL: postgresql+asyncpg://postgres:postgres@postgres:5432/simfleet REDIS_URL: redis://redis:6379/0 CELERY_BROKER_URL: redis://redis:6379/1 CELERY_RESULT_BACKEND: redis://redis:6379/2 SECRET_KEY: your-secret-key-change-in-production command: celery -A app.tasks.celery_app worker --loglevel=info --concurrency=4 depends_on: postgres: condition: service_healthy redis: condition: service_healthy volumes: - ./backend:/app celery-beat: build: context: ./backend dockerfile: Dockerfile container_name: simfleet-celery-beat environment: DATABASE_URL: postgresql+asyncpg://postgres:postgres@postgres:5432/simfleet REDIS_URL: redis://redis:6379/0 CELERY_BROKER_URL: redis://redis:6379/1 CELERY_RESULT_BACKEND: redis://redis:6379/2 SECRET_KEY: your-secret-key-change-in-production command: celery -A app.tasks.celery_app beat --loglevel=info depends_on: postgres: condition: service_healthy redis: condition: service_healthy volumes: - ./backend:/app volumes: postgres_data: redis_data: