-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
405 lines (386 loc) · 12.9 KB
/
docker-compose.yaml
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
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
version: "3.7"
services:
caddy:
container_name: caddy
build: ./docker/caddy
restart: unless-stopped
security_opt:
- no-new-privileges:true
ports:
- "80:80"
- "443:443"
volumes:
- "/etc/timezone:/etc/timezone:ro"
- "/etc/localtime:/etc/localtime:ro"
- "./etc/caddy/data:/data"
- "./etc/caddy/config:/config"
- "./etc/caddy/sites:/etc/caddy/sites"
- "./etc/caddy/Caddyfile:/etc/caddy/Caddyfile"
networks:
caddy-net:
ipv4_address: 172.28.240.2
depends_on:
- pihole
- monitorix
pihole:
image: pihole/pihole:latest
container_name: pihole
hostname: pihole
restart: unless-stopped
ports:
- "53:53/tcp"
- "53:53/udp"
# Disable the DHCP service port binding
#- "67:67/udp"
expose:
- "80"
environment:
TZ: "Asia/Hong_Kong"
WEBPASSWORD: "${WEB_PASSWORD}"
PIHOLE_DNS_: "172.28.241.6#5053;172.28.241.6#5053"
# Listen on all interface not only eth1 by default
# and change the default listen eth0 to eth1 for fallback to pihole-net
# normal:
# - clinet <-> pihole <-> dnscrypt_proxy
# - clinet <-> coredns <-> pihole <-> dnscrypt_proxy
# fallback:
# - clinet <-> coredns <-> pihole <-> dnscrypt_proxy
INTERFACE: "eth1"
DNSMASQ_LISTENING: "all"
DNSMASQ_USER: "pihole"
volumes:
- "/etc/timezone:/etc/timezone:ro"
- "/etc/localtime:/etc/localtime:ro"
- "./etc/pihole:/etc/pihole"
- "./etc/dnsmasq.d:/etc/dnsmasq.d"
dns:
- 1.1.1.1
networks:
caddy-net:
ipv4_address: 172.28.240.4
pihole-net:
ipv4_address: 172.28.241.4
depends_on:
- dnscrypt_proxy
dnscrypt_proxy:
image: klutchell/dnscrypt-proxy:latest
container_name: dnscrypt_proxy
restart: unless-stopped
expose:
- "5053/udp"
- "5053/tcp"
volumes:
- "/etc/timezone:/etc/timezone:ro"
- "/etc/localtime:/etc/localtime:ro"
- "./etc/dnscrypt-proxy/config:/config"
networks:
pihole-net:
ipv4_address: 172.28.241.6
coredns:
container_name: coredns
build: ./docker/coredns
restart: unless-stopped
command: "-conf /etc/coredns/Corefile"
ports:
- "853:853/tcp"
- "853:853/udp"
expose:
- "9253"
volumes:
- "/etc/timezone:/etc/timezone:ro"
- "/etc/localtime:/etc/localtime:ro"
- "./etc/coredns:/etc/coredns"
- "./etc/caddy/data:/data:ro"
networks:
pihole-net:
ipv4_address: 172.28.241.2
monitor-net:
ipv4_address: 172.28.242.14
depends_on:
- caddy
- pihole
- dnscrypt_proxy
monitorix:
image: beartums/rpi-monitorix:latest
container_name: monitorix
restart: unless-stopped
devices:
- "/dev/vchiq:/dev/vchiq"
environment:
MONITORIX_HOSTNAME: "pi-hole"
TITLE: "Pi-Hole Status"
REFRESH_RATE: 150
TEMPERATURE_SCALE: "c"
HTTPD-GROUP: "www-data"
GRAPHS: "system,raspberrypi,kern,proc,process,int,serv,net"
expose:
- "8080"
volumes:
- "/etc/timezone:/etc/timezone:ro"
- "/etc/localtime:/etc/localtime:ro"
- "./etc/monitorix/conf.d:/etc/monitorix/conf.d"
- "./etc/monitorix/assets:/assets"
- "./etc/monitorix/data:/var/lib/monitorix/data"
networks:
caddy-net:
ipv4_address: 172.28.240.8
pihole-net:
ipv4_address: 172.28.241.8
# Enable iptables command
cap_add:
- NET_ADMIN
prometheus:
image: prom/prometheus:latest
container_name: prometheus
restart: unless-stopped
command:
- "--config.file=/etc/prometheus/conf/prometheus.yml"
- "--storage.tsdb.path=/etc/prometheus/data"
- "--storage.tsdb.retention.time=15d"
- "--web.console.libraries=/etc/prometheus/console_libraries"
- "--web.console.templates=/etc/prometheus/consoles"
- "--web.enable-lifecycle"
expose:
- "9090"
volumes:
- "/etc/timezone:/etc/timezone:ro"
- "/etc/localtime:/etc/localtime:ro"
- "./etc/prometheus/conf/rules:/etc/prometheus/conf/rules"
- "./etc/prometheus/conf/prometheus.yml:/etc/prometheus/conf/prometheus.yml:ro"
- "./etc/prometheus/data:/etc/prometheus/data"
networks:
caddy-net:
ipv4_address: 172.28.240.10
pihole-net:
ipv4_address: 172.28.241.10
monitor-net:
ipv4_address: 172.28.242.2
depends_on:
- cadvisor
- node_exporter
- pihole_exporter
- rpi_exporter
cadvisor:
image: zcube/cadvisor:latest
container_name: cadvisor
restart: unless-stopped
privileged: true
devices:
- "/dev/kmsg:/dev/kmsg"
expose:
- "8080"
volumes:
- "/etc/timezone:/etc/timezone:ro"
- "/etc/localtime:/etc/localtime:ro"
- "/:/rootfs:ro"
- "/var/run:/var/run:ro"
- "/sys:/sys:ro"
- "/var/lib/docker/:/var/lib/docker:ro"
- "/dev/disk/:/dev/disk:ro"
networks:
monitor-net:
ipv4_address: 172.28.242.4
node_exporter:
image: prom/node-exporter:v1.0.1
container_name: node_exporter
restart: unless-stopped
command:
- '--path.procfs=/host/proc'
- '--path.sysfs=/host/sys'
- '--path.rootfs=/rootfs'
- '--collector.filesystem.ignored-mount-points=^/(sys|proc|dev|host|etc)($$|/)'
expose:
- "9100"
volumes:
- "/etc/timezone:/etc/timezone:ro"
- "/etc/localtime:/etc/localtime:ro"
- "/proc:/host/proc:ro"
- "/sys:/host/sys:ro"
- "/:/rootfs:ro"
networks:
monitor-net:
ipv4_address: 172.28.242.6
pihole_exporter:
image: ekofr/pihole-exporter:0.0.9
container_name: pihole_exporter
restart: unless-stopped
environment:
PIHOLE_HOSTNAME: "pihole"
PIHOLE_PASSWORD: "${WEB_PASSWORD}"
INTERVAL: "30s"
PORT: "9617"
expose:
- "9617"
networks:
pihole-net:
ipv4_address: 172.28.241.12
monitor-net:
ipv4_address: 172.28.242.8
rpi_exporter:
image: carlosedp/arm_exporter:latest
container_name: rpi_exporter
restart: unless-stopped
devices:
- "/dev/vchiq:/dev/vchiq"
command:
- '--collector.textfile.directory=/etc/rpi_exporter/'
expose:
- "9243"
volumes:
- "/etc/hostname:/etc/nodename:ro"
- "/etc/timezone:/etc/timezone:ro"
- "/etc/localtime:/etc/localtime:ro"
networks:
monitor-net:
ipv4_address: 172.28.242.10
alert_manager:
image: prom/alertmanager:latest
container_name: alert_manager
restart: unless-stopped
command:
- "--config.file=/etc/alert-manager/conf/config.yml"
- '--storage.path=/etc/alert-manager/data'
expose:
- "9093"
volumes:
- "/etc/timezone:/etc/timezone:ro"
- "/etc/localtime:/etc/localtime:ro"
- "./etc/alert-manager/conf/config.yml:/etc/alert-manager/conf/config.yml"
- "./etc/alert-manager/data:/etc/alert-manager/data"
networks:
caddy-net:
ipv4_address: 172.28.240.12
monitor-net:
ipv4_address: 172.28.242.12
grafana:
image: grafana/grafana:latest
container_name: grafana
restart: unless-stopped
command:
# Keep default conf in `/etc/grafana/grafana.ini`
# change default conf by `custom.ini`
# ref:
# - https://grafana.com/docs/grafana/latest/administration/configuration/#config-file-locations
# - https://grafana.com/docs/grafana/latest/installation/configure-docker/#default-paths
- "--config=/etc/grafana/conf/custom.ini"
environment:
TZ: "Asia/Hong_Kong"
GF_PATHS_DATA: "/etc/grafana/data"
GF_PATHS_PROVISIONING: "/etc/grafana/provisioning"
GF_SECURITY_ADMIN_USER: "${GRAFANA_ADMIN_USER}"
GF_SECURITY_ADMIN_PASSWORD: "${GRAFANA_ADMIN_PASSWORD}"
GF_SERVER_ENABLE_GZIP: "true"
GF_USERS_DEFAULT_THEME: "dark"
GF_INSTALL_PLUGINS: "grafana-piechart-panel"
expose:
- "3000"
volumes:
- "/etc/timezone:/etc/timezone:ro"
- "/etc/localtime:/etc/localtime:ro"
- "./etc/grafana/data:/etc/grafana/data"
# Provision the config without manually config after service boot up
# but manual setup by default
# - https://grafana.com/docs/grafana/latest/administration/provisioning/#data-sources
- "./etc/grafana/provisioning:/etc/grafana/provisioning"
- "./etc/grafana/conf/custom.ini:/etc/grafana/conf/custom.ini"
networks:
caddy-net:
ipv4_address: 172.28.240.14
monitor-net:
ipv4_address: 172.28.242.16
depends_on:
- prometheus
cloudflare_ddns:
image: oznu/cloudflare-ddns:latest
container_name: cloudlfare_ddns
restart: always
environment:
API_KEY: "${CLOUDFLARE_DDNS_API_KEY}"
ZONE: "${CLOUDFLARE_DDNS_ZONE}"
SUBDOMAIN: "${CLOUDFLARE_DDNS_DOMAIN}"
PROXIED: "false"
volumes:
- "/etc/timezone:/etc/timezone:ro"
- "/etc/localtime:/etc/localtime:ro"
networks:
pihole-net:
ipv4_address: 172.28.241.14
aria2_pro:
image: p3terx/aria2-pro:latest
container_name: aria2_pro
restart: unless-stopped
environment:
TZ: "Asia/Hong_Kong"
PUID: "${ARIA2_PRO_PUID}"
PGID: "${ARIA2_PRO_PGID}"
RPC_SECRET: "${ARIA2_PRO_RPC_SECRET}"
RPC_PORT: "6800"
LISTEN_PORT: "6898" # for bt 6881-6999
DISK_CACHE: "64M"
IPV6_MODE: "false"
UPDATE_TRACKERS: "true"
expose:
- "6800"
ports:
- "6898:6898/tcp"
- "6898:6898/udp"
volumes:
- "/etc/timezone:/etc/timezone:ro"
- "/etc/localtime:/etc/localtime:ro"
- "./etc/aria2/config:/config"
- "${ARIA2_PRO_DOWNLOADS_PATH}:/downloads"
logging:
driver: json-file
options:
max-size: 1m
networks:
caddy-net:
ipv4_address: 172.28.240.16
aria2_ng:
image: p3terx/ariang:latest
container_name: aria2_ng
restart: unless-stopped
expose:
- "6880"
volumes:
- "/etc/timezone:/etc/timezone:ro"
- "/etc/localtime:/etc/localtime:ro"
logging:
driver: json-file
options:
max-size: 1m
networks:
caddy-net:
ipv4_address: 172.28.240.18
file_browser:
image: filebrowser/filebrowser:pi
container_name: file_browser
restart: unless-stopped
expose:
- "8080"
volumes:
- "/etc/timezone:/etc/timezone:ro"
- "/etc/localtime:/etc/localtime:ro"
- "${FILE_BROWSER_DATA_PATH}:/data"
- "./etc/file-browser/database/filebrowser.db:/database/filebrowser.db"
- "./etc/file-browser/conf/filebrowser.json:/.filebrowser.json"
networks:
caddy-net:
ipv4_address: 172.28.240.20
networks:
caddy-net:
name: caddy-net
external: true
ipam:
config:
- subnet: 172.28.240.0/24
pihole-net:
name: pihole-net
ipam:
config:
- subnet: 172.28.241.0/24
monitor-net:
name: monitor-net
ipam:
config:
- subnet: 172.28.242.0/24