-
Notifications
You must be signed in to change notification settings - Fork 37
/
docker-compose.yml
211 lines (198 loc) · 6.02 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
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
version: '3.8'
x-logging:
&default-logging
driver: "json-file"
options:
max-size: "1m"
max-file: "1"
tag: "{{.Name}}"
x-common-labels: &default-labels
logging: "promtail"
logging_jobname: "containerlogs"
stackname: "docker-monitoring-stack-gpnc"
services:
grafana:
image: grafana/grafana:${GRAFANA_VERSION:-11.0.0}
container_name: grafana
restart: unless-stopped
environment:
- GF_AUTH_ANONYMOUS_ENABLED=true
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
- GF_USERS_DEFAULT_THEME=light
- GF_LOG_MODE=console
- GF_LOG_LEVEL=critical
- GF_PANELS_ENABLE_ALPHA=true
- GF_FEATURE_TOGGLES_ENABLE=accessControlOnCall lokiLogsDataplane
- GF_INSTALL_PLUGINS=grafana-polystat-panel,https://storage.googleapis.com/integration-artifacts/grafana-lokiexplore-app/grafana-lokiexplore-app-latest.zip;grafana-lokiexplore-app
volumes:
- ./configs/grafana/provisioning/dashboards.yml:/etc/grafana/provisioning/dashboards/provisioning-dashboards.yaml:ro
- ./configs/grafana/provisioning/datasources.yml:/etc/grafana/provisioning/datasources/provisioning-datasources.yaml:ro
- ./configs/grafana/plugins/app.yaml:/etc/grafana/provisioning/plugins/app.yaml:ro
- ./dashboards/node-metrics.json:/var/lib/grafana/dashboards/node-metrics.json:ro
- ./dashboards/container-metrics.json:/var/lib/grafana/dashboards/container-metrics.json:ro
- ./dashboards/log-search.json:/var/lib/grafana/dashboards/log-search.json:ro
- grafana-data:/var/lib/grafana
depends_on:
- prometheus
ports:
- 3000:3000
cpus: 0.5
mem_limit: 512m
networks:
- monitoring
labels:
<<: *default-labels
logging: *default-logging
prometheus:
image: prom/prometheus:${PROMETHEUS_VERSION:-v2.42.0}
container_name: prometheus
restart: unless-stopped
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--log.level=error'
- '--storage.tsdb.path=/prometheus'
- '--storage.tsdb.retention.time=7d'
- '--web.console.libraries=/usr/share/prometheus/console_libraries'
- '--web.console.templates=/usr/share/prometheus/consoles'
- '--web.external-url=http://localhost:9090'
volumes:
- ./configs/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
- ./configs/prometheus/recording-rules.yml:/etc/prometheus/recording-rules.yml
- ./configs/prometheus/alerting-rules.yml:/etc/prometheus/alerting-rules.yml
- prometheus-data:/prometheus
depends_on:
- alertmanager
ports:
- 9090:9090
cpus: 0.5
mem_limit: 512m
networks:
- monitoring
labels:
<<: *default-labels
logging: *default-logging
cadvisor:
image: gcr.io/cadvisor/cadvisor:${CADVISOR_VERSION:-v0.46.0}
container_name: cadvisor
restart: unless-stopped
privileged: true
volumes:
- /:/rootfs:ro
- /var/run:/var/run:rw
- /sys:/sys:ro
- /var/lib/docker:/var/lib/docker:ro
# https://github.com/google/cadvisor/issues/1565#issuecomment-718812180
- /var/run/docker.sock:/var/run/docker.sock
#- /dev/disk:/dev/disk:ro
cpus: 0.5
mem_limit: 512m
networks:
- monitoring
labels:
<<: *default-labels
logging: *default-logging
node-exporter:
image: prom/node-exporter:${NODE_EXPORTER_VERSION:-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.sysfs=/host/sys'
- '--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)($$|/)"
cpus: 0.5
mem_limit: 512m
networks:
- monitoring
labels:
<<: *default-labels
logging: *default-logging
alertmanager:
image: prom/alertmanager:${ALERTMANAGER_VERSION:-v0.25.0}
container_name: alertmanager
command:
- '--config.file=/etc/alertmanager/config.yml'
- '--log.level=error'
- '--storage.path=/alertmanager'
- '--web.external-url=http://localhost:9093'
volumes:
- ./configs/alertmanager/alertmanager-fallback-config.yml:/etc/alertmanager/config.yml
ports:
- 9093:9093
cpus: 0.5
mem_limit: 512m
networks:
- monitoring
depends_on:
- uncomplicated-alert-receiver
labels:
<<: *default-labels
logging: *default-logging
uncomplicated-alert-receiver:
image: ghcr.io/jamesread/uncomplicated-alert-receiver
container_name: uncomplicated-alert-receiver
ports:
- 9094:8080
cpus: 0.5
mem_limit: 512m
networks:
- monitoring
labels:
<<: *default-labels
logging: *default-logging
redis:
image: redis:${REDIS_VERSION:-6}
container_name: redis
ports:
- 6379:6379
cpus: 0.5
mem_limit: 512m
networks:
- monitoring
labels:
<<: *default-labels
logging: *default-logging
loki:
image: grafana/loki:3.0.0
container_name: loki
user: root
ports:
- 3100:3100
command: -config.file=/etc/loki/loki.yaml
volumes:
- ./configs/loki/loki.yaml:/etc/loki/loki.yaml
- ./configs/loki/rules.yaml:/etc/loki/rules/fake/loki-rules.yml
cpus: 0.5
mem_limit: 512m
networks:
- monitoring
labels:
<<: *default-labels
logging: *default-logging
promtail:
image: grafana/promtail:3.0.0
container_name: promtail
volumes:
- ./configs/promtail/promtail.yaml:/etc/promtail/docker-config.yaml
- /var/lib/docker/containers:/var/lib/docker/containers:ro
- /var/run/docker.sock:/var/run/docker.sock
command: -config.file=/etc/promtail/docker-config.yaml
depends_on:
- loki
cpus: 0.5
mem_limit: 512m
networks:
- monitoring
labels:
<<: *default-labels
logging: *default-logging
volumes:
grafana-data: {}
prometheus-data: {}
networks:
monitoring:
name: monitoring