| # Production-oriented local server deployment for شَمْl (Diac API + Arabic frontend). | |
| # External services: Hugging Face (model download), Supabase (optional record storage). | |
| services: | |
| backend: | |
| build: | |
| context: . | |
| dockerfile: docker/Dockerfile.backend | |
| container_name: diac-backend | |
| env_file: | |
| - .env | |
| environment: | |
| # Container-internal paths (override host paths from .env when present) | |
| PORT: 8000 | |
| DIAC_CONSTANTS_PATH: /app/constants/ | |
| HF_HOME: /cache/huggingface | |
| TRANSFORMERS_CACHE: /cache/huggingface | |
| ports: | |
| # Expose API directly for debugging/curl; frontend proxies /api in normal use | |
| - "${PORT:-8000}:8000" | |
| volumes: | |
| - ./constants:/app/constants:ro | |
| - huggingface-cache:/cache/huggingface | |
| networks: | |
| - diac-network | |
| restart: unless-stopped | |
| healthcheck: | |
| test: ["CMD", "curl", "-f", "http://127.0.0.1:8000/health"] | |
| interval: 30s | |
| timeout: 10s | |
| retries: 3 | |
| start_period: 180s | |
| frontend: | |
| build: | |
| context: ./frontend | |
| dockerfile: Dockerfile | |
| args: | |
| VITE_API_BASE_URL: ${VITE_API_BASE_URL:-/api} | |
| VITE_API_KEY: ${VITE_API_KEY:-} | |
| container_name: diac-frontend | |
| ports: | |
| - "${FRONTEND_PORT:-80}:80" | |
| depends_on: | |
| backend: | |
| condition: service_healthy | |
| networks: | |
| - diac-network | |
| restart: unless-stopped | |
| healthcheck: | |
| test: ["CMD", "curl", "-f", "http://127.0.0.1/"] | |
| interval: 30s | |
| timeout: 5s | |
| retries: 3 | |
| networks: | |
| diac-network: | |
| driver: bridge | |
| name: diac-network | |
| volumes: | |
| huggingface-cache: | |
| name: diac-huggingface-cache | |