Spaces:
Sleeping
Sleeping
| version: "3.9" | |
| services: | |
| # ------------------------------------------------------------------------- | |
| # FastAPI inference API → http://localhost:8000 | |
| # Swagger docs → http://localhost:8000/docs | |
| # ------------------------------------------------------------------------- | |
| api: | |
| build: | |
| context: . | |
| dockerfile: Dockerfile.api | |
| ports: | |
| - "8000:8000" | |
| volumes: | |
| - ./checkpoints:/app/checkpoints | |
| restart: unless-stopped | |
| healthcheck: | |
| test: ["CMD", "curl", "-f", "http://localhost:8000/health"] | |
| interval: 30s | |
| timeout: 10s | |
| retries: 3 | |
| # ------------------------------------------------------------------------- | |
| # Gradio UI → http://localhost:7860 | |
| # ------------------------------------------------------------------------- | |
| gradio: | |
| build: | |
| context: . | |
| dockerfile: Dockerfile | |
| ports: | |
| - "7860:7860" | |
| volumes: | |
| - ./checkpoints:/app/checkpoints | |
| depends_on: | |
| - api | |
| restart: unless-stopped | |
| # ------------------------------------------------------------------------- | |
| # Prometheus → http://localhost:9090 | |
| # ------------------------------------------------------------------------- | |
| prometheus: | |
| image: prom/prometheus:latest | |
| ports: | |
| - "9090:9090" | |
| volumes: | |
| - ./monitoring/prometheus.yml:/etc/prometheus/prometheus.yml:ro | |
| - prometheus_data:/prometheus | |
| command: | |
| - "--config.file=/etc/prometheus/prometheus.yml" | |
| - "--storage.tsdb.retention.time=7d" | |
| depends_on: | |
| - api | |
| restart: unless-stopped | |
| # ------------------------------------------------------------------------- | |
| # Grafana → http://localhost:3000 (admin / admin) | |
| # ------------------------------------------------------------------------- | |
| grafana: | |
| image: grafana/grafana:latest | |
| ports: | |
| - "3001:3000" | |
| environment: | |
| - GF_SECURITY_ADMIN_USER=admin | |
| - GF_SECURITY_ADMIN_PASSWORD=admin | |
| - GF_USERS_ALLOW_SIGN_UP=false | |
| volumes: | |
| - grafana_data:/var/lib/grafana | |
| - ./monitoring/grafana/provisioning:/etc/grafana/provisioning:ro | |
| - ./monitoring/grafana/dashboards:/var/lib/grafana/dashboards:ro | |
| depends_on: | |
| - prometheus | |
| restart: unless-stopped | |
| volumes: | |
| prometheus_data: | |
| grafana_data: | |