-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
251 lines (242 loc) · 6.14 KB
/
Copy pathdocker-compose.yml
File metadata and controls
251 lines (242 loc) · 6.14 KB
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
version: '3.9'
networks:
public:
driver: bridge
private:
driver: bridge
internal: false
volumes:
grafana_lib:
driver: local
grafana_ds:
driver: local
influxdb_data:
driver: local
prometheus_data:
driver: local
services:
influxdb:
image: influxdb:2.7-alpine
container_name: influxdb
restart: unless-stopped
ports:
- "${INFLUXDB_PORT}:8086"
networks:
- public
- private
volumes:
- influxdb_data:/var/lib/influxdb2
environment:
INFLUXDB_DB: ${INFLUXDB_DB}
INFLUXDB_ADMIN_USER: ${INFLUXDB_ADMIN_USER}
INFLUXDB_ADMIN_PASSWORD: ${INFLUXDB_ADMIN_PASSWORD}
INFLUXDB_USER: ${INFLUXDB_USER}
INFLUXDB_USER_PASSWORD: ${INFLUXDB_USER_PASSWORD}
INFLUXDB_REPORTING_DISABLED: "true"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8086/ping"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
deploy:
resources:
limits:
cpus: '2'
memory: 2G
reservations:
cpus: '0.5'
memory: 512M
grafana:
image: grafana/grafana:10.2-alpine
container_name: grafana
restart: unless-stopped
ports:
- "${GRAFANA_PORT}:3000"
networks:
- public
- private
volumes:
- grafana_lib:/var/lib/grafana
- grafana_ds:/var/lib/grafana/ds
- ./grafana/provisioning:/etc/grafana/provisioning:ro
environment:
GF_SECURITY_ADMIN_USER: ${GF_SECURITY_ADMIN_USER}
GF_SECURITY_ADMIN_PASSWORD: ${GF_SECURITY_ADMIN_PASSWORD}
GF_AUTH_ANONYMOUS_ENABLED: ${GF_AUTH_ANONYMOUS_ENABLED}
GF_SERVER_PROTOCOL: ${GF_SERVER_PROTOCOL}
GF_SERVER_DOMAIN: ${GF_SERVER_DOMAIN}
GF_SERVER_METRICS_ENABLED: "true"
GF_SERVER_METRICS_INTERVAL_SECONDS: ${METRICS_INTERVAL}
GF_INSTALL_PLUGINS: "grafana-piechart-panel"
depends_on:
influxdb:
condition: service_healthy
prometheus:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/api/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
deploy:
resources:
limits:
cpus: '1'
memory: 1G
reservations:
cpus: '0.25'
memory: 256M
telegraf:
image: telegraf:1.28-alpine
container_name: telegraf
restart: unless-stopped
network_mode: "host"
volumes:
- ./telegraf.conf:/etc/telegraf/telegraf.conf:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
- /proc:/host/proc:ro
- /sys:/host/sys:ro
environment:
INFLUXDB_URI: http://localhost:${INFLUXDB_PORT}
INFLUXDB_DB: ${INFLUXDB_DB}
INFLUXDB_USER: ${INFLUXDB_USER}
INFLUXDB_USER_PASSWORD: ${INFLUXDB_USER_PASSWORD}
TELEGRAF_DEBUG: ${TELEGRAF_DEBUG}
HOSTNAME: ${HOSTNAME:-localhost}
deploy:
resources:
limits:
cpus: '0.5'
memory: 512M
reservations:
cpus: '0.25'
memory: 128M
prometheus:
image: prom/prometheus:v2.48.1
container_name: prometheus
restart: unless-stopped
volumes:
- ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prometheus_data:/prometheus
networks:
- private
- public
command:
- "--config.file=/etc/prometheus/prometheus.yml"
- "--storage.tsdb.path=/prometheus"
- "--storage.tsdb.retention.time=${RETENTION_DAYS}d"
ports:
- "${PROMETHEUS_PORT}:9090"
depends_on:
- node_exporter
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9090/-/healthy"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
deploy:
resources:
limits:
cpus: '1'
memory: 1G
reservations:
cpus: '0.25'
memory: 256M
node_exporter:
image: prom/node-exporter:v1.7.0
container_name: node_exporter
restart: unless-stopped
networks:
- public
- private
ports:
- "9101:9100"
expose:
- "9100"
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
command:
- "--path.procfs=/host/proc"
- "--path.sysfs=/host/sys"
- "--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)"
- "--collector.netdev.device-exclude=^(docker|br-|veth)"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9100"]
interval: 30s
timeout: 10s
retries: 3
deploy:
resources:
limits:
cpus: '0.5'
memory: 256M
reservations:
cpus: '0.1'
memory: 64M
cadvisor:
image: gcr.io/cadvisor/cadvisor:v0.47.0
container_name: cadvisor
restart: unless-stopped
volumes:
- /:/rootfs:ro
- /var/run:/var/run:rw
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
- /dev/disk:/dev/disk:ro
networks:
- private
- public
expose:
- "8080"
ports:
- "8081:8080"
command:
- "--port=8080"
- "--housekeeping_interval=30s"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/"]
interval: 30s
timeout: 10s
retries: 3
deploy:
resources:
limits:
cpus: '0.5'
memory: 512M
reservations:
cpus: '0.25'
memory: 128M
alertmanager:
image: prom/alertmanager:v0.26.0
container_name: alertmanager
restart: unless-stopped
networks:
- private
- public
ports:
- "9093:9093"
volumes:
- ./alertmanager/config.yml:/etc/alertmanager/config.yml:ro
- ./alertmanager/templates:/etc/alertmanager/templates:ro
command:
- "--config.file=/etc/alertmanager/config.yml"
- "--storage.path=/alertmanager"
- "--web.external-url=http://${GF_SERVER_DOMAIN}:9093"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9093/-/healthy"]
interval: 30s
timeout: 10s
retries: 3
deploy:
resources:
limits:
cpus: '0.5'
memory: 256M
reservations:
cpus: '0.1'
memory: 64M