Last active
December 31, 2023 16:18
-
-
Save roadev/e98997a4e59616ad9e3be5fe26e4864f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker-compose.yml for prometheus + node_exporter + grafana + cadvisor | |
--- | |
version: '1.0' | |
volumes: | |
prometheus-data: | |
driver: local | |
grafana-data: | |
driver: local | |
services: | |
prometheus: | |
image: prom/prometheus:v2.37.9 | |
container_name: prometheus | |
user: root | |
ports: | |
- 9090:9090 | |
command: "--config.file=/etc/prometheus/prometheus.yml" | |
volumes: | |
- ./config/prometheus.yml:/etc/prometheus/prometheus.yml:ro | |
- ./data:/prometheus | |
restart: unless-stopped | |
grafana: | |
image: grafana/grafana-oss:latest | |
container_name: grafana | |
ports: | |
- "3000:3000" | |
volumes: | |
- grafana-data:/var/lib/grafana | |
restart: unless-stopped | |
node_exporter: | |
image: quay.io/prometheus/node-exporter:v1.5.0 | |
container_name: node_exporter | |
command: "--path.rootfs=/host" | |
pid: host | |
restart: unless-stopped | |
volumes: | |
- /:/host:ro,rslave | |
cadvisor: | |
image: gcr.io/cadvisor/cadvisor:v0.47.0 | |
container_name: cadvisor | |
ports: | |
- 8080: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 | |
privileged: true | |
restart: unless-stopped |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment