91 lines
2.2 KiB
YAML
91 lines
2.2 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
# Python Flask API for Grafana data source
|
|
monitoring-api:
|
|
build: .
|
|
container_name: monitoring-api
|
|
ports:
|
|
- "5000:5000"
|
|
environment:
|
|
- API_BASE_URL=https://api-personalizeit.zapplataforma.chat
|
|
- API_USERNAME=${API_USERNAME}
|
|
- API_PASSWORD=${API_PASSWORD}
|
|
- FLASK_PORT=5000
|
|
- FLASK_HOST=0.0.0.0
|
|
- DEBUG=False
|
|
- REFRESH_INTERVAL=5
|
|
- QUEUE_IDS=-1,1,2,3,4,5,7
|
|
volumes:
|
|
- ./.env:/app/.env:ro
|
|
networks:
|
|
- monitoring
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:5000/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 40s
|
|
|
|
# Grafana for visualization
|
|
grafana:
|
|
image: grafana/grafana:latest
|
|
container_name: grafana
|
|
ports:
|
|
- "3000:3000"
|
|
environment:
|
|
- GF_SECURITY_ADMIN_PASSWORD=admin
|
|
- GF_SECURITY_ADMIN_USER=admin
|
|
- GF_USERS_ALLOW_SIGN_UP=false
|
|
volumes:
|
|
- grafana-storage:/var/lib/grafana
|
|
- ./grafana/provisioning:/etc/grafana/provisioning:ro
|
|
- ./grafana/images:/usr/share/grafana/public/img/custom:ro
|
|
networks:
|
|
- monitoring
|
|
restart: unless-stopped
|
|
depends_on:
|
|
- monitoring-api
|
|
|
|
# Prometheus for scraping metrics (optional)
|
|
prometheus:
|
|
image: prom/prometheus:latest
|
|
container_name: prometheus
|
|
ports:
|
|
- "9090:9090"
|
|
volumes:
|
|
- ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
|
|
- prometheus-storage:/prometheus
|
|
command:
|
|
- '--config.file=/etc/prometheus/prometheus.yml'
|
|
- '--storage.tsdb.path=/prometheus'
|
|
networks:
|
|
- monitoring
|
|
restart: unless-stopped
|
|
depends_on:
|
|
- monitoring-api
|
|
- blackbox-exporter
|
|
|
|
# Blackbox exporter for monitoring external applications
|
|
blackbox-exporter:
|
|
image: prom/blackbox-exporter:latest
|
|
container_name: blackbox-exporter
|
|
ports:
|
|
- "9115:9115"
|
|
volumes:
|
|
- ./blackbox.yml:/etc/blackbox_exporter/config.yml:ro
|
|
command:
|
|
- '--config.file=/etc/blackbox_exporter/config.yml'
|
|
networks:
|
|
- monitoring
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
grafana-storage:
|
|
prometheus-storage:
|
|
|
|
networks:
|
|
monitoring:
|
|
driver: bridge
|