monitoring/docker-compose.yml
2022-12-10 09:55:52 +01:00

139 lines
3.6 KiB
YAML

version: '3.8'
networks:
monitoring:
driver: bridge
traefik:
external: true
services:
grafana:
image: grafana/grafana:9.3.1
container_name: grafana
restart: unless-stopped
volumes:
- ./data/grafana:/var/lib/grafana
- ./conf/grafana/provisioning:/etc/grafana/provisioning
ports:
- 3000:3000
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD}
- GF_USERS_ALLOW_SIGN_UP=false
networks:
- monitoring
- traefik
labels:
- "traefik.enable=true"
- "traefik.http.routers.grafana.rule=Host(`grafana.${HOST_SUFFIX}`)"
- "traefik.http.routers.grafana.entrypoints=web"
prometheus:
image: prom/prometheus:v2.40.6
container_name: prometheus
restart: unless-stopped
volumes:
- ./conf/prometheus:/etc/prometheus
- ./data/prometheus:/prometheus
ports:
- 9090:9090
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/etc/prometheus/console_libraries'
- '--web.console.templates=/etc/prometheus/consoles'
- '--web.enable-lifecycle'
- "--web.external-url=http://prometheus.${HOST_SUFFIX}"
expose:
- 9090
networks:
- monitoring
- traefik
labels:
- "traefik.enable=true"
- "traefik.http.routers.prometheus.rule=Host(`prometheus.${HOST_SUFFIX}`)"
- "traefik.http.routers.prometheus.entrypoints=web"
alertmanager:
image: prom/alertmanager:v0.24.0
container_name: alertmanager
restart: unless-stopped
volumes:
- ./conf/alertmanager:/etc/alertmanager
- ./data/alertmanager:/alertmanager
environment:
- TZ=${TZ}
ports:
- 9093:9093
command:
- '--config.file=/etc/alertmanager/alertmanager.yml'
- '--storage.path=/alertmanager'
- "--web.external-url=http://alertmanager.${HOST_SUFFIX}"
expose:
- 9093
networks:
- monitoring
- traefik
labels:
- "traefik.enable=true"
- "traefik.http.routers.alertmanager.rule=Host(`alertmanager.${HOST_SUFFIX}`)"
- "traefik.http.routers.alertmanager.entrypoints=web"
node-exporter:
image: prom/node-exporter:v1.5.0
container_name: node-exporter
restart: unless-stopped
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
command:
- '--path.procfs=/host/proc'
- '--path.rootfs=/rootfs'
- '--path.sysfs=/host/sys'
- '--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)'
expose:
- 9100
networks:
- monitoring
blackbox_exporter:
image: prom/blackbox-exporter:v0.23.0
container_name: blackbox
restart: unless-stopped
expose:
- 9115
networks:
- monitoring
# smokeping:
# image: quay.io/superq/smokeping-prober
# container_name: smokeping
# restart: unless-stopped
# command: nyyu.dev
# privileged: true
# expose:
# - 9374
# networks:
# - monitoring
cadvisor:
# ARM image
image: gcr.io/cadvisor/cadvisor-arm:v0.46.0
container_name: cadvisor
restart: unless-stopped
command:
- '--housekeeping_interval=10s'
- '--raw_cgroup_prefix_whitelist=/docker/'
- '--disable_metrics=cpu_topology,hugetlb'
privileged: true
pid: 'host'
ports:
- '8040:8080'
volumes:
- '/:/rootfs:ro'
- '/var/run:/var/run:ro'
- '/sys:/sys:ro'
- '/var/lib/docker/:/var/lib/docker:ro'
- '/dev/disk/:/dev/disk:ro'
devices:
- '/dev/kmsg:/dev/kmsg'
expose:
- 8080
networks:
- monitoring