forked from publicarray/dns-resolver-infra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
198 lines (185 loc) · 3.77 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
version: '3.2'
volumes:
dnscrypt:
ssl:
nsd:
services:
acme:
image: neilpang/acme.sh
command: >
/bin/sh -c "echo \"#!/bin/sh
set -e
if [ -f /opt/ssl/fullchain.pem ]; then
if openssl x509 -checkend 2592000 -noout -in /opt/ssl/fullchain.pem; then
echo 'Certificate is still valid!'
exit 0
else
echo 'Certificate has expired or will do so within 30 days!'
echo 'Renewing...'
fi
fi
export CF_Key='$$(cat /run/secrets/CF_Key)'
export CF_Email='$$(cat /run/secrets/CF_Email)'
#### Remember to remove '--staging' in production! ####
acme.sh
--issue
--staging
--dns dns_cf
--dnssleep 60
-d doh.seby.io
--fullchain-file /opt/ssl/fullchain.pem
--key-file /opt/ssl/key.pem
--ca-file /opt/ssl/ca.pem
--cert-file /opt/ssl/cert.pem
--reloadcmd 'cat /opt/ssl/key.pem > cat /opt/ssl/fullchain.pem > /opt/ssl/fullchain-key.pem'\" > start.sh
&& chmod +x start.sh
&& ./start.sh"
deploy:
resources:
reservations :
cpus: "0.2"
memory: 50M
restart_policy:
condition: none
secrets:
- CF_Email
- CF_Key
volumes:
- ssl:/opt/ssl
nsd:
build: nsd
image: publicarray/nsd
deploy:
replicas: 1
resources:
limits:
memory: 200M
reservations:
cpus: '0.1'
memory: 100M
restart_policy:
condition: any
delay: 5s
volumes:
- nsd:/etc/nsd/run
networks:
- nsd-net
unbound:
depends_on:
- nsd
build: unbound
image: publicarray/unbound
command: munin
deploy:
replicas: 1
resources:
limits:
memory: 300M
reservations :
cpus: "0.2"
memory: 256M
restart_policy:
condition: any
delay: 5s
ports:
- target: 4949
published: 4949
protocol: tcp
mode: ingress
networks:
- nsd-net
- unbound-net
doh-proxy:
depends_on:
- unbound
build: doh-proxy
image: publicarray/doh-proxy
deploy:
replicas: 1
resources:
reservations :
cpus: "0.1"
memory: 10M
restart_policy:
condition: any
delay: 5s
networks:
- unbound-net
haproxy:
depends_on:
- acme
- doh-proxy
- unbound
build: haproxy
image: publicarray/haproxy
deploy:
replicas: 1
resources:
reservations :
cpus: "0.2"
memory: 50M
restart_policy:
condition: any
delay: 5s
ports:
- "443:443"
- target: 853
published: 853
protocol: tcp
mode: ingress
- target: 853
published: 853
protocol: udp
mode: ingress
volumes:
- ssl:/opt/ssl
networks:
- haproxy-net
- unbound-net
dnscrypt-wrapper:
depends_on:
- unbound
image: publicarray/dnscrypt-wrapper
command:
- init
- -N
- dns.seby.io
- -E
- 149.28.165.94:8443
deploy:
replicas: 1
resources:
reservations :
cpus: "0.2"
memory: 10M
restart_policy:
condition: any
delay: 5s
ports:
- target: 443
published: 8443
protocol: tcp
mode: ingress
- target: 443
published: 8443
protocol: udp
mode: ingress
volumes:
- dnscrypt:/opt/dnscrypt
networks:
- dnscrypt-net
- unbound-net
secrets:
CF_Email:
external: true
CF_Key:
external: true
networks:
dnscrypt-net:
driver: overlay
haproxy-net:
driver: overlay
nsd-net:
driver: overlay
unbound-net:
driver: overlay