forked from Freekers/ansible-adguard
-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml.j2
158 lines (142 loc) · 5.44 KB
/
docker-compose.yml.j2
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
version: "3"
networks:
traefik_proxy:
name: traefik_proxy
backend:
driver: bridge
ipam:
config:
- subnet: 10.5.0.0/24
gateway: 10.5.0.1
ip_range: 10.5.0.5/30
services:
traefik:
image: traefik:latest
container_name: traefik
restart: {{dockerrestartpolicy}}
networks:
- traefik_proxy
ports:
- "80:80" # web
- "443:443" # websecure
- "853:853"
- "53:53"
- "53:53/udp"
#- "8456:8456" # metrics port
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
- "/srv/docker/traefik2/rules:/rules"
- "/srv/docker/traefik2/acme:/letsencrypt"
- "/srv/docker/traefik2/traefik.yaml:/etc/traefik/traefik.yaml"
environment:
- TZ={{ntp_timezone}}
labels:
- traefik.enable=true
- traefik.docker.network=traefik_proxy
- traefik.http.routers.traefikdashboard.rule=Host(`blocky.traefik.{{hostname}}`) && (PathPrefix(`/api`) || PathPrefix(`/dashboard`))
- traefik.http.routers.traefikdashboard.entrypoints=websecure
- traefik.http.routers.traefikdashboard.service=api@internal
- traefik.http.routers.traefikdashboard.tls=true
- traefik.http.routers.traefikdashboard.tls.certresolver=lets-encrypt
- traefik.http.routers.traefikdashboard.middlewares=middlewares-ipwhitelist@file, redirect-web-to-websecure@internal, middlewares-rate-limit@file, middlewares-compress@file
adguard:
image: adguard/adguardhome:latest
container_name: adguard
restart: {{dockerrestartpolicy}}
networks:
- traefik_proxy
- backend
environment:
- TZ={{ntp_timezone}}
volumes:
- /srv/docker/adguard/conf:/opt/adguardhome/conf
- /srv/docker/adguard/work:/opt/adguardhome/work
labels:
- "traefik.enable=true"
- "traefik.docker.network=traefik_proxy"
# web interface
- traefik.http.routers.adfree.rule=Host(`adfree.{{hostname}}`)
- traefik.http.routers.adfree.entrypoints=websecure
- traefik.http.routers.adfree.tls.certresolver=lets-encrypt
- traefik.http.services.adfree.loadbalancer.server.port=80
# DNS-over-TLS
- "traefik.tcp.routers.dnsovertls.rule=HostSNI(`adfree.{{hostname}}`)"
- "traefik.tcp.routers.dnsovertls.entrypoints=dnsovertls"
- "traefik.tcp.routers.dnsovertls.tls=true"
- "traefik.tcp.routers.dnsovertls.tls.certresolver=lets-encrypt"
- "traefik.tcp.routers.dnsovertls.service=adfree"
# Normal DNS coming in on 53 TCP, no TLS
- "traefik.tcp.routers.dns.rule=HostSNI(`adfree.{{hostname}}`)"
- "traefik.tcp.routers.dns.entrypoints=dns"
- "traefik.tcp.routers.dns.tls=false"
- "traefik.tcp.routers.dns.service=adfree"
# recieves traffic from both the TLS and non-TLS traefik routers
- "traefik.tcp.services.adfree.loadbalancer.server.port=53"
# Normal DNS coming in on 53 UDP
- "traefik.udp.routers.udpdns.entrypoints=udpdns"
- "traefik.udp.routers.udpdns.service=adfree"
- "traefik.udp.services.adfree.loadbalancer.server.port=53"
# blocky:
# image: spx01/blocky
# container_name: blocky
# restart: {{dockerrestartpolicy}}
# networks:
# - traefik_proxy
# - backend
# environment:
# - TZ={{ntp_timezone}}
# volumes:
# - /srv/docker/blocky/blocky.yaml:/app/config.yml
# labels:
# - "traefik.enable=true"
# - "traefik.docker.network=traefik_proxy"
# # web interface
# # - traefik.http.routers.blocky.rule=Host(`blocky.{{hostname}}`)
# # - traefik.http.routers.blocky.entrypoints=websecure
# # - traefik.http.routers.blocky.tls.certresolver=lets-encrypt
# # - traefik.http.services.blocky.loadbalancer.server.port=80
# # DNS-over-TLS
# - "traefik.tcp.routers.dnsovertls.rule=HostSNI(`blocky.{{hostname}}`)"
# - "traefik.tcp.routers.dnsovertls.entrypoints=dnsovertls"
# - "traefik.tcp.routers.dnsovertls.tls=true"
# - "traefik.tcp.routers.dnsovertls.tls.certresolver=lets-encrypt"
# - "traefik.tcp.routers.dnsovertls.service=blocky"
# # Normal DNS coming in on 53 TCP, no TLS
# - "traefik.tcp.routers.dns.rule=HostSNI(`blocky.{{hostname}}`)"
# - "traefik.tcp.routers.dns.entrypoints=dns"
# - "traefik.tcp.routers.dns.tls=false"
# - "traefik.tcp.routers.dns.service=blocky"
# # recieves traffic from both the TLS and non-TLS traefik routers
# - "traefik.tcp.services.blocky.loadbalancer.server.port=53"
# # Normal DNS coming in on 53 UDP
# - "traefik.udp.routers.udpdns.entrypoints=udpdns"
# - "traefik.udp.routers.udpdns.service=blocky"
# - "traefik.udp.services.blocky.loadbalancer.server.port=53"
unbound:
image: crazymax/unbound
container_name: unbound
restart: {{dockerrestartpolicy}}
networks:
backend:
ipv4_address: 10.5.0.6
ports:
- "5053:5053/tcp"
- "5053:5053/udp"
volumes:
- "/srv/docker/unbound/forward-records.conf:/config/forward-records.conf:ro"
watchtower:
container_name: watchtower
restart: {{dockerrestartpolicy}}
network_mode: bridge
image: containrrr/watchtower:latest
environment:
- WATCHTOWER_CLEANUP=true
- WATCHTOWER_REMOVE_VOLUMES=true
- WATCHTOWER_INCLUDE_STOPPED=true
- TZ={{ntp_timezone}}
- WATCHTOWER_DEBUG=false
- WATCHTOWER_RUN_ONCE=false
volumes:
- /var/run/docker.sock:/var/run/docker.sock
labels:
- traefik.enable=false