-
Notifications
You must be signed in to change notification settings - Fork 12
/
docker-compose.yml
212 lines (202 loc) · 5.74 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
212
version: '3.5'
services:
cadvisor:
image: google/cadvisor
volumes:
- /:/rootfs:ro
- /var/run:/var/run:rw
- /sys:/sys:ro
- /var/lib/docker:/var/lib/docker:ro
networks:
- private
- public
deploy:
mode: global
resources:
limits:
memory: 128M
node-exporter:
image: ruanbekker/node-exporter:v0.18.0
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
- /etc/hostname:/etc/host_hostname
- /etc/hostname:/etc/nodename
ports:
- 9100:9100
environment:
- HOST_HOSTNAME=/etc/host_hostname
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)($$|/)"
- '--collector.textfile.directory=/etc/node-exporter/'
networks:
- private
deploy:
mode: global
resources:
limits:
memory: 128M
blackbox-exporter:
image: prom/blackbox-exporter:v0.12.0
networks:
- private
deploy:
mode: replicated
replicas: 1
resources:
limits:
memory: 64M
alertmanager:
image: prom/alertmanager:v0.17.0
configs:
- source: alertmanager_config
target: /etc/alertmanager/config.yml
- source: basicauth_htpasswd
target: /etc/htpasswd
command:
- '--config.file=/etc/alertmanager/config.yml'
- '--storage.path=/alertmanager'
volumes:
- alertmanager:/alertmanager
networks:
- private
- public
deploy:
replicas: 1
placement:
constraints:
- node.role==manager
resources:
limits:
memory: 100M
labels:
- traefik.frontend.rule=Host:alertmanager.${DOMAIN:-localhost}
- traefik.frontend.auth.basic.usersFile=/etc/htpasswd
- traefik.enable=true
- traefik.port=9093
- traefik.tags=public
- traefik.backend=alertmanager
- traefik.docker.network=public
- traefik.redirectorservice.frontend.entryPoints=http
- traefik.redirectorservice.frontend.redirect.entryPoint=https
- traefik.webservice.frontend.entryPoints=https
prometheus:
image: prom/prometheus:v2.9.2
user: root
volumes:
- promconfig:/etc/prometheus
- promdata:/prometheus
configs:
- source: prometheus_config
target: /etc/prometheus/prometheus.yml
- source: prometheus_rules
target: /etc/prometheus/alert.rules
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/etc/prometheus/console_libraries'
- '--web.console.templates=/etc/prometheus/consoles'
networks:
- private
- public
deploy:
placement:
constraints:
- node.role==manager
resources:
limits:
memory: 500M
labels:
- traefik.frontend.rule=Host:prometheus.${DOMAIN:-localhost}
- traefik.enable=true
- traefik.port=9090
- traefik.tags=public
- traefik.backend=prometheus
- traefik.docker.network=public
- traefik.redirectorservice.frontend.entryPoints=http
- traefik.redirectorservice.frontend.redirect.entryPoint=https
- traefik.webservice.frontend.entryPoints=https
pushgateway:
image: prom/pushgateway:v0.8.0
networks:
- private
- public
configs:
- source: basicauth_htpasswd
target: /etc/htpasswd
deploy:
replicas: 1
placement:
constraints:
- node.role==manager
resources:
limits:
memory: 64M
labels:
- traefik.frontend.rule=Host:pushgateway.${DOMAIN:-localhost}
- traefik.frontend.auth.basic.usersFile=/etc/htpasswd
- traefik.enable=true
- traefik.port=9091
- traefik.tags=public
- traefik.backend=pushgateway
- traefik.docker.network=public
- traefik.redirectorservice.frontend.entryPoints=http
- traefik.redirectorservice.frontend.redirect.entryPoint=https
- traefik.webservice.frontend.entryPoints=https
grafana:
image: grafana/grafana:6.2.1
volumes:
- grafanadata:/var/lib/grafana
environment:
- GF_SERVER_ROOT_URL=http://grafana.${DOMAIN:-localhost}
- GF_SECURITY_ADMIN_USER=${GRAFANA_USER:-admin}
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD:-admin}
- GF_USERS_ALLOW_SIGN_UP=false
- GF_INSTALL_PLUGINS=grafana-piechart-panel
- PROMETHEUS_ENDPOINT=http://prometheus:9090
networks:
- private
- public
deploy:
replicas: 1
placement:
constraints:
- node.role==manager
resources:
limits:
memory: 384M
labels:
- traefik.frontend.rule=Host:grafana.${DOMAIN:-localhost}
- traefik.enable=true
- traefik.port=3000
- traefik.tags=public
- traefik.backend=grafana
- traefik.docker.network=public
- traefik.redirectorservice.frontend.entryPoints=http
- traefik.redirectorservice.frontend.redirect.entryPoint=https
- traefik.webservice.frontend.entryPoints=https
networks:
private:
name: private
driver: overlay
public:
name: public
external: true
volumes:
promconfig: {}
promdata: {}
grafanadata: {}
alertmanager: {}
configs:
alertmanager_config:
file: ./alertmanager/configs/alertmanager.yml
prometheus_config:
file: ./prometheus/configs/prometheus.yml
prometheus_rules:
file: ./prometheus/rules/alert.rules
basicauth_htpasswd:
file: ./htpasswd