version: '3.9' services: postgres: image: postgres:16-alpine environment: POSTGRES_DB: trustos POSTGRES_USER: trustos POSTGRES_PASSWORD: ${DB_PASSWORD:?Database password required} ports: - "5432:5432" volumes: - postgres_data:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U trustos"] interval: 10s timeout: 5s retries: 5 backend: build: context: . dockerfile: Dockerfile.prod target: backend environment: DATABASE_URL: postgresql+asyncpg://trustos:${DB_PASSWORD}@postgres:5432/trustos SYNC_DATABASE_URL: postgresql://trustos:${DB_PASSWORD}@postgres:5432/trustos SECRET_KEY: ${SECRET_KEY:?Secret key required} OPENAI_API_KEY: ${OPENAI_API_KEY:-} ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY:-} AI_PROVIDER: ${AI_PROVIDER:-openai} ports: - "8000:8000" depends_on: postgres: condition: service_healthy healthcheck: test: ["CMD", "curl", "-f", "http://localhost:8000/docs"] interval: 30s timeout: 10s retries: 3 frontend: build: context: . dockerfile: Dockerfile.prod target: frontend environment: NEXT_PUBLIC_API_URL: ${API_URL:?API URL required} ports: - "3000:3000" depends_on: - backend volumes: postgres_data: