-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
docker-compose.yml
192 lines (176 loc) · 5.21 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
version: '3.4'
volumes:
dnscrypt:
dnscrypt-server:
ssl:
nsd:
acme-sh:
acme-acc:
services:
acme:
image: docker.io/neilpang/acme.sh
container_name: acme
command: >
/bin/sh -c "echo \"#!/bin/sh
set -e
acme.sh --set-default-ca --server letsencrypt
if [ -n ${HEALTHCHECK} ]; then
acme.sh --issue --dns dns_cf --dnssleep 60 --domain '${DOMAIN}' --keylength ec-384 --fullchain-file /opt/ssl/fullchain-ecc.pem --key-file /opt/ssl/key-ecc.pem --ca-file /opt/ssl/ca-ecc.pem --cert-file /opt/ssl/cert-ecc.pem --pre-hook 'curl -fsS -m 10 --retry 5 -o /dev/null https://hc-ping.com/${HEALTHCHECK}'
else
acme.sh --issue --dns dns_cf --dnssleep 60 --domain '${DOMAIN}' --keylength ec-384 --fullchain-file /opt/ssl/fullchain-ecc.pem --key-file /opt/ssl/key-ecc.pem --ca-file /opt/ssl/ca-ecc.pem --cert-file /opt/ssl/cert-ecc.pem
fi
acme.sh --deploy -d '${DOMAIN}' --ecc --deploy-hook docker
\" > start.sh
&& chmod +x start.sh
&& ./start.sh"
logging:
driver: "json-file"
options:
max-size: "200k"
max-file: "10"
environment:
- HEALTHCHECK=${HEALTHCHECK}
- CF_Email=${CF_EMAIL}
- CF_Key=${CF_KEY}
- CF_Token=${CF_TOKEN}
- CF_Account_ID=${CF_ACCOUNT_ID}
- CF_Zone_ID=${CF_ZONE_ID}
- DOMAIN=${DOMAIN}
- DEPLOY_DOCKER_CONTAINER_LABEL=sh.acme.autoload.domain=${DOMAIN}
- DEPLOY_DOCKER_CONTAINER_KEY_FILE=/opt/ssl/key-ecc.pem
- DEPLOY_DOCKER_CONTAINER_CERT_FILE="/opt/ssl/cert-ecc.pem"
- DEPLOY_DOCKER_CONTAINER_CA_FILE="/opt/ssl/ca-ecc.pem"
- DEPLOY_DOCKER_CONTAINER_FULLCHAIN_FILE="/opt/ssl/fullchain-ecc.pem"
- DEPLOY_DOCKER_CONTAINER_RELOAD_CMD="cat /opt/ssl/key-ecc.pem > cat /opt/ssl/fullchain-ecc.pem > /opt/ssl/fullchain-key.pem.ecdsa; sv restart haproxy"
volumes:
- ssl:/opt/ssl
- ./run/acmeout:/acme.sh
- /var/run/docker.sock:/var/run/docker.sock
acme-daemon:
container_name: acme-daemon
restart: on-failure:2
image: docker.io/neilpang/acme.sh
command: daemon
logging:
driver: "json-file"
options:
max-size: "200k"
max-file: "10"
volumes:
- ssl:/opt/ssl
- ./run/acmeout:/acme.sh
- /var/run/docker.sock:/var/run/docker.sock
environment:
- DOMAIN=${DOMAIN}
- HEALTHCHECK=${HEALTHCHECK}
- DEPLOY_DOCKER_CONTAINER_LABEL=sh.acme.autoload.domain=${DOMAIN}
- DEPLOY_DOCKER_CONTAINER_KEY_FILE=/opt/ssl/key-ecc.pem
- DEPLOY_DOCKER_CONTAINER_CERT_FILE="/opt/ssl/cert-ecc.pem"
- DEPLOY_DOCKER_CONTAINER_CA_FILE="/opt/ssl/ca-ecc.pem"
- DEPLOY_DOCKER_CONTAINER_FULLCHAIN_FILE="/opt/ssl/fullchain-ecc.pem"
- DEPLOY_DOCKER_CONTAINER_RELOAD_CMD="cat /opt/ssl/key-ecc.pem > cat /opt/ssl/fullchain-ecc.pem > /opt/ssl/fullchain-key.pem.ecdsa; sv restart haproxy"
nsd:
container_name: nsd
restart: on-failure:5
build: nsd
image: ghcr.io/publicarray/dns-resolver-infra/nsd
logging:
driver: "json-file"
options:
max-size: "200k"
max-file: "10"
volumes:
- nsd:/etc/nsd/run
unbound:
container_name: unbound
restart: on-failure:5
depends_on:
- nsd
build: unbound
image: ghcr.io/publicarray/dns-resolver-infra/unbound
command: -d nsd
logging:
driver: "json-file"
options:
max-size: "200k"
max-file: "10"
# ports:
# - target: 4949
# published: 4949
# protocol: tcp
# mode: ingress
m13253-doh:
container_name: doh
restart: on-failure:5
depends_on:
- unbound
build: m13253-doh
image: ghcr.io/publicarray/dns-resolver-infra/m13253-doh
command: -d unbound
logging:
driver: "json-file"
options:
max-size: "200k"
max-file: "10"
# doh-proxy:
# container_name: doh-proxy
# restart: on-failure:5
# depends_on:
# - unbound
# build: doh-proxy
# image: ghcr.io/publicarray/dns-resolver-infra/doh-proxy
# command: -d
haproxy:
container_name: haproxy
restart: on-failure:5
depends_on:
- acme
- m13253-doh
- unbound
labels:
- sh.acme.autoload.domain=${DOMAIN}
build: haproxy
image: ghcr.io/publicarray/dns-resolver-infra/haproxy
command: -d -r
logging:
driver: "json-file"
options:
max-size: "200k"
max-file: "10"
ports:
- "443:443/tcp"
- "853:853/tcp"
- "443:443/udp"
- "853:853/udp"
volumes:
- ssl:/opt/ssl
environment:
- DOMAIN=${DOMAIN}
# dnscrypt-server:
# container_name: dnscrypt-server
# restart: on-failure:5
# depends_on:
# - unbound
# - haproxy
# image: ghcr.io/publicarray/dns-resolver-infra/dnscrypt-server
# command:
# - init
# - -d unbound
# - -N
# - dns.seby.io
# - -T
# - haproxy
# - -E
# - 139.99.222.72:8443
# - -A
# logging:
# driver: "json-file"
# options:
# max-size: "200k"
# max-file: "10"
# ports:
# - "443:8443/tcp"
# - "443:8443/udp"
# volumes:
# - dnscrypt:/opt/dnscrypt-wrapper
# - dnscrypt-server:/opt/encrypted-dns