# Environment variables (see .env.example) x-shared-env: &shared-env # All persistent paths live under /data (mounted volume) DATA_DIR: /data HF_HOME: /data/huggingface WHISPER_MODEL: ${WHISPER_MODEL:-tiny} DEVICE: ${DEVICE-} DIARIZATION_ENABLED: ${DIARIZATION_ENABLED:-true} HUGGINGFACE_TOKEN: ${HUGGINGFACE_TOKEN:-} LOG_LEVEL: ${LOG_LEVEL:-INFO} XDG_CACHE_HOME: /data/huggingface HUGGINGFACE_HUB_CACHE: /data/huggingface/hub TRANSFORMERS_CACHE: /data/huggingface/transformers TORCH_HOME: /data/huggingface/torch MPLCONFIGDIR: /data/matplotlib services: frontend: build: context: ./frontend dockerfile: Dockerfile args: NEXT_PUBLIC_API_URL: ${NEXT_PUBLIC_API_URL:-http://localhost:8000} container_name: call-analyzer-frontend ports: - "3000:3000" environment: - NODE_ENV=production depends_on: api: condition: service_healthy restart: unless-stopped networks: - call-analyzer-network healthcheck: test: ["CMD-SHELL", "wget -q -O /dev/null http://localhost:3000 || exit 1"] interval: 45s timeout: 30s retries: 3 start_period: 30s api: build: context: ./backend dockerfile: Dockerfile container_name: call-analyzer-api ports: - "8000:8000" environment: <<: *shared-env PYTHONUNBUFFERED: 1 ENVIRONMENT: production DATA_DIR: /data UPLOAD_FOLDER: /data/uploads SPEAKER_DATA_DIR: /data/speakers # Keep the settings DB on the mounted volume DATABASE_URL: sqlite:////data/call_analyzer.db # Allow model downloads on first run (cached in the volume) TRANSFORMERS_OFFLINE: 0 HF_DATASETS_OFFLINE: 0 AUTO_REBUILD_INDEX: ${AUTO_REBUILD_INDEX:-false} restart: unless-stopped volumes: # Single mount: all paths below live under /data (see DATA_DIR) - call_analyzer_data:/data healthcheck: test: ["CMD", "wget", "--no-verbose", "--tries=1", "--method=GET", "--output-document=-", "http://localhost:8000/health"] interval: 45s timeout: 30s retries: 3 start_period: 900s networks: - call-analyzer-network # GPU support: uncomment if you have an NVIDIA GPU and nvidia-container-runtime installed # deploy: # resources: # reservations: # devices: # - driver: nvidia # count: 1 # capabilities: [gpu] volumes: # Application data (uploads, indices, model cache, etc.) call_analyzer_data: driver: local networks: call-analyzer-network: driver: bridge