Spaces:
Sleeping
Sleeping
| version: '3.8' | |
| services: | |
| crop-disease-api: | |
| build: | |
| context: . | |
| dockerfile: api/Dockerfile | |
| ports: | |
| - "8000:8000" | |
| volumes: | |
| - ./models:/app/models:ro | |
| - ./knowledge_base:/app/knowledge_base:ro | |
| - ./outputs:/app/outputs | |
| environment: | |
| - PYTHONPATH=/app | |
| - MODEL_PATH=/app/models/crop_disease_v3_model.pth | |
| restart: unless-stopped | |
| healthcheck: | |
| test: ["CMD", "curl", "-f", "http://localhost:8000/health"] | |
| interval: 30s | |
| timeout: 10s | |
| retries: 3 | |
| # Optional: Add nginx reverse proxy for production | |
| # nginx: | |
| # image: nginx:alpine | |
| # ports: | |
| # - "80:80" | |
| # - "443:443" | |
| # volumes: | |
| # - ./nginx.conf:/etc/nginx/nginx.conf:ro | |
| # - ./ssl:/etc/nginx/ssl:ro | |
| # depends_on: | |
| # - crop-disease-api | |
| # restart: unless-stopped | |
| networks: | |
| default: | |
| name: crop-disease-network | |