version: "3.9" services: # ── PostgreSQL ─────────────────────────────────────────────────── postgres: image: postgres:16-alpine container_name: fap-postgres restart: unless-stopped environment: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres POSTGRES_DB: finance_platform ports: - "5432:5432" volumes: - pgdata:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U postgres"] interval: 5s timeout: 3s retries: 5 # ── Redis ──────────────────────────────────────────────────────── redis: image: redis:7-alpine container_name: fap-redis restart: unless-stopped ports: - "6379:6379" volumes: - redisdata:/data healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 5s timeout: 3s retries: 5 # ── Backend (FastAPI) ──────────────────────────────────────────── backend: build: context: ./backend dockerfile: Dockerfile container_name: fap-backend restart: unless-stopped env_file: - ./backend/.env environment: DATABASE_URL: postgresql+asyncpg://postgres:postgres@postgres:5432/finance_platform REDIS_URL: redis://redis:6379/0 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 (Vite / React) ───────────────────────────────────── frontend: build: context: ./frontend dockerfile: Dockerfile container_name: fap-frontend restart: unless-stopped ports: - "5173:5173" depends_on: - backend volumes: - ./frontend:/app - /app/node_modules command: npm run dev -- --host 0.0.0.0 volumes: pgdata: redisdata: