version: '3.8' services: # PostgreSQL database postgres: image: postgres:15-alpine container_name: apac_ops_bot_postgres environment: POSTGRES_USER: apac_ops_bot POSTGRES_PASSWORD: secure_password POSTGRES_DB: apac_ops_bot volumes: - postgres_data:/var/lib/postgresql/data ports: - "5432:5432" healthcheck: test: ["CMD-SHELL", "pg_isready -U apac_ops_bot"] interval: 10s timeout: 5s retries: 5 networks: - apac_network restart: unless-stopped # Redis for caching and rate limiting redis: image: redis:7-alpine container_name: apac_ops_bot_redis ports: - "6399:6379" healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 10s timeout: 5s retries: 5 networks: - apac_network restart: unless-stopped # FastAPI backend backend: build: context: ./backend dockerfile: Dockerfile target: development container_name: apac_ops_bot_backend command: uvicorn app.main:app --host 0.0.0.0 --port 8048 --reload volumes: - ./backend:/app ports: - "8048:8048" env_file: - ./backend/.env environment: - DATABASE_URL=postgresql+asyncpg://apac_ops_bot:secure_password@postgres:5432/apac_ops_bot - REDIS_URL=redis://redis:6379/0 depends_on: postgres: condition: service_healthy redis: condition: service_healthy networks: - apac_network restart: unless-stopped # React frontend frontend: build: context: ./frontend dockerfile: Dockerfile target: development container_name: apac_ops_bot_frontend volumes: - ./frontend:/app - /app/node_modules ports: - "3000:3000" env_file: - ./frontend/.env environment: - REACT_APP_API_URL=/apac-ops-bot-back/api/v1 - REACT_APP_WS_URL=/apac-ops-bot-back/ws depends_on: - backend networks: - apac_network restart: unless-stopped volumes: postgres_data: networks: apac_network: driver: bridge