version: "3.9" services: got-ocr: build: . image: got-ocr:latest container_name: got-ocr-backend ports: - "8000:8000" environment: - PYTHONUNBUFFERED=1 restart: unless-stopped # ── GPU support (comment out for CPU-only) ─────────────────────────── deploy: resources: reservations: devices: - driver: nvidia count: 1 capabilities: [gpu] # ── Health check ───────────────────────────────────────────────────── healthcheck: test: ["CMD", "curl", "-f", "http://localhost:8000/health"] interval: 30s timeout: 10s retries: 5 start_period: 60s # give model time to load # ── Optional: persist HuggingFace model cache across rebuilds ──────── volumes: - hf_cache:/root/.cache/huggingface volumes: hf_cache: