4b782ffdc8
- README completo con istruzioni di installazione, configurazione e utilizzo - API Swagger/OpenAPI documentata - File env.example con variabili di configurazione - Dockerfile multi-stage ottimizzato - Docker Compose con Ollama e LLM Monitor - Struttura completa dell'app FastAPI (main.py, config, api routes) - Servizio client Ollama reusabile - Dashboard web HTML con TailwindCSS - Test suite con pytest - Makefile per comandi comuni - CONTRIBUTING.md per i contributori - LICENSE MIT - .editorconfig e .dockerignore - requirements.txt e requirements-dev.txt
70 lines
1.6 KiB
YAML
70 lines
1.6 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
# Ollama Service
|
|
ollama:
|
|
image: ollama/ollama:latest
|
|
container_name: ollama-server
|
|
ports:
|
|
- "11434:11434"
|
|
environment:
|
|
OLLAMA_HOST: 0.0.0.0:11434
|
|
volumes:
|
|
- ollama_data:/root/.ollama
|
|
restart: unless-stopped
|
|
# Keep container running until stopped
|
|
stdin_open: true
|
|
tty: true
|
|
networks:
|
|
- llm-monitor-network
|
|
|
|
# LLM Monitor Dashboard
|
|
llm-monitor:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
container_name: llm-monitor-app
|
|
ports:
|
|
- "8000:8000"
|
|
environment:
|
|
# Carica variabili da .env
|
|
OLLAMA_HOST: http://ollama:11434
|
|
OLLAMA_TIMEOUT: 30
|
|
API_HOST: 0.0.0.0
|
|
API_PORT: 8000
|
|
API_WORKERS: 4
|
|
CORS_ORIGINS: http://localhost:3000,http://localhost:5173,http://localhost:8000
|
|
LOG_LEVEL: INFO
|
|
ENVIRONMENT: production
|
|
env_file:
|
|
- .env
|
|
depends_on:
|
|
- ollama
|
|
restart: unless-stopped
|
|
stdin_open: true
|
|
tty: true
|
|
networks:
|
|
- llm-monitor-network
|
|
# Health check
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:8000/api/v1/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 10s
|
|
|
|
volumes:
|
|
ollama_data:
|
|
driver: local
|
|
|
|
networks:
|
|
llm-monitor-network:
|
|
driver: bridge
|
|
|
|
# Istruzioni di avvio:
|
|
# docker compose up -d # Avvia i servizi
|
|
# docker compose logs -f # Visualizza i log
|
|
# docker compose down # Ferma i servizi
|
|
# docker compose stop ollama # Ferma solo Ollama
|
|
# docker compose start ollama # Riavvia Ollama
|