Spaces:
Running
Running
| version: '3.8' | |
| services: | |
| # Ollama service for local LLM inference | |
| ollama: | |
| image: ollama/ollama:latest | |
| container_name: summarizer-ollama | |
| ports: | |
| - "11434:11434" | |
| volumes: | |
| - ollama_data:/root/.ollama | |
| environment: | |
| - OLLAMA_HOST=0.0.0.0 | |
| restart: unless-stopped | |
| healthcheck: | |
| test: ["CMD", "curl", "-f", "http://localhost:11434/api/tags"] | |
| interval: 30s | |
| timeout: 10s | |
| retries: 3 | |
| start_period: 40s | |
| # FastAPI backend service | |
| api: | |
| build: . | |
| container_name: summarizer-api | |
| ports: | |
| - "8000:8000" | |
| environment: | |
| - OLLAMA_HOST=http://ollama:11434 | |
| - OLLAMA_MODEL=llama3.1:8b | |
| - OLLAMA_TIMEOUT=60 | |
| - SERVER_HOST=0.0.0.0 | |
| - SERVER_PORT=8000 | |
| - LOG_LEVEL=INFO | |
| depends_on: | |
| ollama: | |
| condition: service_healthy | |
| restart: unless-stopped | |
| healthcheck: | |
| test: ["CMD", "curl", "-f", "http://localhost:8000/health"] | |
| interval: 30s | |
| timeout: 10s | |
| retries: 3 | |
| start_period: 10s | |
| # Optional: Nginx reverse proxy for production | |
| nginx: | |
| image: nginx:alpine | |
| container_name: summarizer-nginx | |
| ports: | |
| - "80:80" | |
| - "443:443" | |
| volumes: | |
| - ./nginx.conf:/etc/nginx/nginx.conf:ro | |
| depends_on: | |
| - api | |
| restart: unless-stopped | |
| profiles: | |
| - production | |
| volumes: | |
| ollama_data: | |
| driver: local | |
| networks: | |
| default: | |
| name: summarizer-network | |