healthcheck ok

This commit is contained in:
hamza rahmani 2025-01-09 15:50:58 +01:00
parent 5301aba9a4
commit 70f0d6f57e

View File

@ -6,12 +6,11 @@ networks:
- subnet: 192.168.100.0/24
volumes:
prometheus_data: {}
grafana_data: {}
prometheus_data: {}
grafana_data: {}
services:
# POUR AFFICHAGE DASHBOARD
grafana:
image: grafana/grafana:11.2.0
container_name: grafana
@ -30,8 +29,12 @@ services:
ipv4_address: 192.168.100.10
labels:
org.label-schema.group: "monitoring"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/api/health"]
interval: 30s
timeout: 5s
retries: 3
# METRICS GATHERER
prometheus:
image: prom/prometheus:v2.54.1
container_name: prometheus
@ -52,8 +55,12 @@ services:
- grafana-network
labels:
org.label-schema.group: "monitoring"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9090/-/healthy"]
interval: 30s
timeout: 5s
retries: 3
# FOR HOST METRICS
nodeexporter:
image: prom/node-exporter:v1.8.2
container_name: nodeexporter
@ -73,8 +80,12 @@ services:
- grafana-network
labels:
org.label-schema.group: "monitoring"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9100/metrics"]
interval: 30s
timeout: 5s
retries: 3
# FOR DOCKER CONTAINERS
cadvisor:
image: gcr.io/cadvisor/cadvisor
container_name: cadvisor
@ -91,8 +102,12 @@ services:
- grafana-network
labels:
org.label-schema.group: "monitoring"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/healthz"]
interval: 30s
timeout: 5s
retries: 3
# LOKI FOR LOGS
loki:
image: grafana/loki:latest
container_name: loki
@ -103,19 +118,21 @@ services:
- ./loki/cert:/etc/loki/cert
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
# environment:
command: -config.file=/etc/loki/config.yml -config.expand-env=true
networks:
- grafana-network
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3100/ready"]
interval: 30s
timeout: 5s
retries: 3
# FOR ALERTS
alertmanager:
image: prom/alertmanager:v0.20.0
container_name: alertmanager
volumes:
- ./alertmanager:/etc/alertmanager
command:
#- '--config.file=/etc/alertmanager/config.yml'
- '--config.file=/etc/alertmanager/alertmanager.yml'
- '--storage.path=/alertmanager'
restart: unless-stopped
@ -125,6 +142,11 @@ services:
- grafana-network
labels:
org.label-schema.group: "monitoring"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9093/-/ready"]
interval: 30s
timeout: 5s
retries: 3
pushgateway:
image: prom/pushgateway:v1.2.0
@ -136,3 +158,8 @@ services:
- grafana-network
labels:
org.label-schema.group: "monitoring"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9091/metrics"]
interval: 30s
timeout: 5s
retries: 3