maurocarlu's picture
aggiornamento documentazione e refactor struttura repo per docker
7af74d7
services:
hopcroft-api:
build:
context: ..
dockerfile: Dockerfile
container_name: hopcroft-api
ports:
- "8080:8080"
env_file:
- ../.env
environment:
- PROJECT_NAME=Hopcroft
volumes:
# Bind mount: enables live code reloading for development
- ../hopcroft_skill_classification_tool_competition:/app/hopcroft_skill_classification_tool_competition
# Named volume: persistent storage for application logs
- hopcroft-logs:/app/logs
networks:
- hopcroft-net
# Override CMD for development with auto-reload
command: >
uvicorn hopcroft_skill_classification_tool_competition.main:app --host 0.0.0.0 --port 8080 --reload
restart: unless-stopped
healthcheck:
test: [ "CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8080/health', timeout=5)" ]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
hopcroft-gui:
build:
context: ..
dockerfile: docker/Dockerfile.streamlit
container_name: hopcroft-gui
ports:
- "8501:8501"
environment:
- API_BASE_URL=http://hopcroft-api:8080
volumes:
# Bind mount for development hot-reload
- ../hopcroft_skill_classification_tool_competition/streamlit_app.py:/app/streamlit_app.py
networks:
- hopcroft-net
depends_on:
hopcroft-api:
condition: service_healthy
restart: unless-stopped
prometheus:
image: prom/prometheus:latest
container_name: prometheus
volumes:
- ../monitoring/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
- ../monitoring/prometheus/alert_rules.yml:/etc/prometheus/alert_rules.yml
ports:
- "9090:9090"
networks:
- hopcroft-net
depends_on:
- alertmanager
restart: unless-stopped
alertmanager:
image: prom/alertmanager:latest
container_name: alertmanager
volumes:
- ../monitoring/alertmanager/config.yml:/etc/alertmanager/config.yml
ports:
- "9093:9093"
networks:
- hopcroft-net
restart: unless-stopped
grafana:
image: grafana/grafana:latest
container_name: grafana
ports:
- "3000:3000"
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=admin
- GF_USERS_ALLOW_SIGN_UP=false
- GF_SERVER_ROOT_URL=http://localhost:3000
volumes:
# Provisioning: auto-configure datasources and dashboards
- ../monitoring/grafana/provisioning/datasources:/etc/grafana/provisioning/datasources
- ../monitoring/grafana/provisioning/dashboards:/etc/grafana/provisioning/dashboards
- ../monitoring/grafana/dashboards:/var/lib/grafana/dashboards
# Persistent storage for Grafana data
- grafana-data:/var/lib/grafana
networks:
- hopcroft-net
depends_on:
- prometheus
restart: unless-stopped
healthcheck:
test: [ "CMD-SHELL", "curl -f http://localhost:3000/api/health || exit 1" ]
interval: 30s
timeout: 10s
retries: 3
pushgateway:
image: prom/pushgateway:latest
container_name: pushgateway
ports:
- "9091:9091"
networks:
- hopcroft-net
restart: unless-stopped
command:
- '--web.listen-address=:9091'
- '--persistence.file=/data/pushgateway.data'
- '--persistence.interval=5m'
volumes:
- pushgateway-data:/data
networks:
hopcroft-net:
driver: bridge
volumes:
hopcroft-logs:
driver: local
grafana-data:
driver: local
pushgateway-data:
driver: local