File size: 939 Bytes
2e552e9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
version: "3.9"

services:
  # ─── Single container: FastAPI + Gradio on port 7860 ─────────────────────
  # This mirrors the HF Spaces deployment (single exposed port).
  # Access:
  #   UI  β†’  http://localhost:7860/ui
  #   API β†’  http://localhost:7860/predict
  #   Health β†’ http://localhost:7860/health
  app:
    build:
      context: .
      dockerfile: Dockerfile
    ports:
      - "7860:7860"
    volumes:
      - ./models:/app/models   # hot-swap model files without rebuilding
    environment:
      - PYTHONPATH=/app
      - PNEUMOOPS_PROFILE=chestmnist
      - PORT=7860
      # Optional: set PNEUMOOPS_API_KEY to protect /predict in production
      # - PNEUMOOPS_API_KEY=change-me
    restart: unless-stopped
    healthcheck:
      test: ["CMD", "curl", "-f", "http://127.0.0.1:7860/health"]
      interval: 30s
      timeout: 5s
      start_period: 40s
      retries: 3