this repo has no description
1services:
2 grafana:
3 container_name: monitoring-grafana
4 image: grafana/grafana:latest
5 hostname: rpi-grafana
6 restart: unless-stopped
7 networks:
8 - monitor-network
9 - internal
10 env_file:
11 - ./grafana/.env
12 volumes:
13 - grafana-data:/var/lib/grafana
14 depends_on:
15 - prometheus
16 healthcheck:
17 test: ["CMD", "wget", "-O", "/dev/null", "http://localhost:3000/api/health"]
18 interval: 30s
19 timeout: 10s
20 retries: 3
21 start_period: 30s
22 labels:
23 com.example.description: Grafana Dashboard
24 com.example.service: monitoring
25 glance.name: Grafana
26 glance.icon: si:grafana
27 glance.url: https://grafana.tulkdan.dev
28 glance.id: grafana
29 logging:
30 driver: "json-file"
31 options:
32 max-size: "10m"
33 max-file: "3"
34
35 cadvisor:
36 container_name: monitoring-cadvisor
37 image: gcr.io/cadvisor/cadvisor:latest
38 hostname: rpi-cadvisor
39 restart: unless-stopped
40 cap_add:
41 - SYS_ADMIN
42 networks:
43 - internal
44 expose:
45 - 8080
46 command:
47 - '-housekeeping_interval=15s'
48 - '-docker_only=true'
49 - '-store_container_labels=false'
50 devices:
51 - /dev/kmsg
52 volumes:
53 - /:/rootfs:ro
54 - /var/run:/var/run:rw
55 - /sys:/sys:ro
56 - /var/lib/docker/:/var/lib/docker:ro
57 - /dev/disk/:/dev/disk:ro
58 - /etc/machine-id:/etc/machine-id:ro
59 healthcheck:
60 test: ["CMD", "wget", "-O", "/dev/null", "http://localhost:8080/healthz"]
61 interval: 30s
62 timeout: 10s
63 retries: 3
64 labels:
65 com.example.description: cAdvisor Container Monitoring
66 com.example.service: monitoring
67 glance.name: CAdvisor
68 glance.parent: grafana
69 logging:
70 driver: "json-file"
71 options:
72 max-size: "10m"
73 max-file: "3"
74 mem_limit: 256m
75 mem_reservation: 128m
76
77 node-exporter:
78 container_name: monitoring-node-exporter
79 image: prom/node-exporter:latest
80 hostname: rpi-exporter
81 restart: unless-stopped
82 networks:
83 - internal
84 expose:
85 - 9100
86 command:
87 - --path.procfs=/host/proc
88 - --path.sysfs=/host/sys
89 - --path.rootfs=/host
90 - --collector.filesystem.ignored-mount-points
91 - ^/(sys|proc|dev|host|etc|rootfs/var/lib/docker/containers|rootfs/var/lib/docker/overlay2|rootfs/run/docker/netns|rootfs/var/lib/docker/aufs)($$|/)
92 volumes:
93 - /proc:/host/proc:ro
94 - /sys:/host/sys:ro
95 - /:/rootfs:ro
96 - /:/host:ro,rslave
97 healthcheck:
98 test: ["CMD", "wget", "-O", "/dev/null", "http://localhost:9100/metrics"]
99 interval: 30s
100 timeout: 10s
101 retries: 3
102 labels:
103 com.example.description: Node Exporter
104 com.example.service: monitoring
105 glance.name: Node exporter
106 glance.parent: grafana
107 logging:
108 driver: "json-file"
109 options:
110 max-size: "10m"
111 max-file: "3"
112 mem_limit: 128m
113 mem_reservation: 64m
114
115 prometheus:
116 container_name: monitoring-prometheus
117 image: prom/prometheus:latest
118 hostname: rpi-prometheus
119 restart: unless-stopped
120 user: "nobody"
121 command:
122 - '--config.file=/etc/prometheus/prometheus.yml'
123 - '--storage.tsdb.path=/prometheus'
124 - '--storage.tsdb.retention.time=1y'
125 - '--storage.tsdb.retention.size=10GB'
126 - '--web.console.libraries=/usr/share/prometheus/console_libraries'
127 - '--web.console.templates=/usr/share/prometheus/consoles'
128 networks:
129 - internal
130 expose:
131 - 9090
132 volumes:
133 - prometheus-data:/prometheus
134 - ./prometheus.yml:/etc/prometheus/prometheus.yml
135 depends_on:
136 - cadvisor
137 - node-exporter
138 healthcheck:
139 test: ["CMD", "wget", "-O", "/dev/null", "http://localhost:9090/-/healthy"]
140 interval: 30s
141 timeout: 10s
142 retries: 3
143 start_period: 30s
144 labels:
145 com.example.description: Prometheus Time Series Database
146 com.example.service: monitoring
147 glance.name: Prometheus
148 glance.parent: grafana
149 logging:
150 driver: "json-file"
151 options:
152 max-size: "10m"
153 max-file: "3"
154 mem_limit: 1g
155 mem_reservation: 512m
156
157volumes:
158 grafana-data:
159 labels:
160 - "com.example.description=Grafana Persistent Data"
161 - "com.example.service=monitoring"
162 prometheus-data:
163 labels:
164 - "com.example.description=Prometheus Persistent Data"
165 - "com.example.service=monitoring"
166
167networks:
168 internal:
169 driver: bridge
170 ipam:
171 driver: default
172 config:
173 - subnet: 172.20.0.0/16
174 gateway: 172.20.0.1
175 labels:
176 - "com.example.description=Monitoring Network"
177 - "com.example.service=monitoring"
178 monitor-network:
179 name: proxy-network
180 external: true