-
Notifications
You must be signed in to change notification settings - Fork 66
/
docker-compose.yml
96 lines (92 loc) · 2.46 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
version: "3"
services:
grafana:
container_name: monitoring-grafana
image: grafana/grafana:latest
hostname: rpi-grafana
restart: unless-stopped
user: "472"
networks:
- internal
ports:
- "3000:3000"
env_file:
- ./grafana/.env
volumes:
# /!\ To be modified depending on your needs /!\
- ./grafana/data:/var/lib/grafana
- ./grafana/provisioning:/etc/grafana/provisioning
depends_on:
- prometheus
cadvisor:
container_name: monitoring-cadvisor
image: gcr.io/cadvisor/cadvisor:v0.49.1
hostname: rpi-cadvisor
restart: unless-stopped
privileged: true
networks:
- internal
expose:
- 8080
command:
- '-housekeeping_interval=15s'
- '-docker_only=true'
- '-store_container_labels=false'
devices:
- /dev/kmsg
volumes:
- /:/rootfs:ro
- /var/run:/var/run:rw
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
- /dev/disk/:/dev/disk:ro
- /etc/machine-id:/etc/machine-id:ro
node-exporter:
container_name: monitoring-node-exporter
image: prom/node-exporter:latest
hostname: rpi-exporter
restart: unless-stopped
networks:
- internal
expose:
- 9100
command:
- --path.procfs=/host/proc
- --path.sysfs=/host/sys
- --path.rootfs=/host
- --collector.filesystem.ignored-mount-points
- ^/(sys|proc|dev|host|etc|rootfs/var/lib/docker/containers|rootfs/var/lib/docker/overlay2|rootfs/run/docker/netns|rootfs/var/lib/docker/aufs)($$|/)
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
- /:/host:ro,rslave
prometheus:
container_name: monitoring-prometheus
image: prom/prometheus:latest
hostname: rpi-prometheus
restart: unless-stopped
user: "nobody"
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--storage.tsdb.retention.time=1y'
# /!\ Uncomment the following line to set a size limit for the Prometheus database /!\
# - '--storage.tsdb.retention.size=10GB'
networks:
- internal
expose:
- 9090
volumes:
# /!\ To be modified depending on your needs /!\
- ./prometheus/data:/prometheus
- ./prometheus:/etc/prometheus/
depends_on:
- cadvisor
- node-exporter
links:
- cadvisor:cadvisor
- node-exporter:node-exporter
networks:
internal:
driver: bridge