Spaces:
Sleeping
Sleeping
| # ========================================== | |
| # SAAP Docker Compose - Development Setup | |
| # ========================================== | |
| services: | |
| # PostgreSQL Database | |
| postgres: | |
| image: postgres:15-alpine | |
| container_name: saap-postgres | |
| environment: | |
| POSTGRES_DB: ${POSTGRES_DB:-saap_db} | |
| POSTGRES_USER: ${POSTGRES_USER:-saap_user} | |
| POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-saap_password} | |
| POSTGRES_INITDB_ARGS: "--encoding=UTF-8 --lc-collate=C --lc-ctype=C" | |
| volumes: | |
| - postgres_data:/var/lib/postgresql/data | |
| ports: | |
| - "${POSTGRES_PORT:-5432}:5432" | |
| healthcheck: | |
| test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-saap_user} -d ${POSTGRES_DB:-saap_db}"] | |
| interval: 10s | |
| timeout: 5s | |
| retries: 5 | |
| networks: | |
| - saap-network | |
| restart: unless-stopped | |
| # Backend API (FastAPI) | |
| backend: | |
| build: | |
| context: ./backend | |
| dockerfile: Dockerfile | |
| container_name: saap-backend | |
| env_file: | |
| - backend/.env | |
| environment: | |
| # Database - Direct PostgreSQL connection | |
| DATABASE_URL: postgresql://saap_user:saap_password@postgres:5432/saap_db | |
| # API Keys (from .env file) | |
| COLOSSUS_API_KEY: ${COLOSSUS_API_KEY} | |
| OPENROUTER_API_KEY: ${OPENROUTER_API_KEY} | |
| # Application Settings | |
| ENVIRONMENT: production | |
| DEBUG: ${DEBUG:-false} | |
| LOG_LEVEL: ${LOG_LEVEL:-INFO} | |
| # CORS Settings | |
| CORS_ORIGINS: ${CORS_ORIGINS:-http://localhost:5173,http://localhost:80} | |
| # Security | |
| SECRET_KEY: ${SECRET_KEY:-dev-secret-key-change-in-production} | |
| volumes: | |
| - ./backend:/app | |
| - backend_logs:/app/logs | |
| ports: | |
| - "${BACKEND_PORT:-8000}:8000" | |
| depends_on: | |
| postgres: | |
| condition: service_healthy | |
| healthcheck: | |
| test: ["CMD", "curl", "-f", "http://localhost:8000/health"] | |
| interval: 30s | |
| timeout: 10s | |
| retries: 3 | |
| start_period: 40s | |
| networks: | |
| - saap-network | |
| restart: unless-stopped | |
| # Frontend (Vue.js + Nginx) | |
| frontend: | |
| build: | |
| context: ./frontend | |
| dockerfile: Dockerfile | |
| container_name: saap-frontend | |
| environment: | |
| VITE_API_BASE_URL: ${VITE_API_BASE_URL:-http://localhost:8000} | |
| VITE_WS_URL: ${VITE_WS_URL:-ws://localhost:8000/ws} | |
| ports: | |
| - "${FRONTEND_PORT:-5173}:80" | |
| depends_on: | |
| - backend | |
| healthcheck: | |
| test: ["CMD", "curl", "-f", "http://localhost/"] | |
| interval: 30s | |
| timeout: 10s | |
| retries: 3 | |
| start_period: 40s | |
| networks: | |
| - saap-network | |
| restart: unless-stopped | |
| networks: | |
| saap-network: | |
| driver: bridge | |
| volumes: | |
| postgres_data: | |
| driver: local | |
| backend_logs: | |
| driver: local | |