-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
265 lines (251 loc) · 7.18 KB
/
Copy pathdocker-compose.yml
File metadata and controls
265 lines (251 loc) · 7.18 KB
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
x-logging: &logging
logging:
driver: syslog
options:
syslog-address: tcp://10.5.5.1:514
syslog-format: rfc3164
tag: '{{.Name}}'
x-app-env: &app-env
TZ: UTC
DOMAIN_NAME: ${DOMAIN_NAME?}
DATA_DIR_ROOT: /data
NODE_ENV: ${NODE_ENV?} #See https://github.com/nodejs/docker-node/blob/main/docs/BestPractices.md
# Unset means rate limiting is ON. Set by `make start-api` (and `start-website`,
# which depends on it) for api-test. The api logs which state it started in.
RATE_LIMITING_DISABLED: ${RATE_LIMITING_DISABLED:-}
# DEBUG: '*' # Useful for debuggind Express.js routing
SMTP_CONNECTION_STRING: ${SMTP_CONNECTION_STRING?}
PADDLE_ENVIRONMENT: ${PADDLE_ENVIRONMENT?}
PADDLE_CLIENT_TOKEN: ${PADDLE_CLIENT_TOKEN?}
PADDLE_API_KEY: ${PADDLE_API_KEY?}
PADDLE_WEBHOOK_SECRET: ${PADDLE_WEBHOOK_SECRET?}
x-disable-ipv6: &x-disable-ipv6
sysctls:
net.ipv6.conf.all.disable_ipv6: 1
net.ipv6.conf.default.disable_ipv6: 1
net.ipv6.conf.lo.disable_ipv6: 1
x-dns: &x-dns
dns: 10.5.5.2
services:
smtp-out:
depends_on:
logger:
condition: service_healthy
resolver:
condition: service_healthy
container_name: smtp-out
hostname: smtp-out
image: smtp-out
restart: always
ports: ['127.0.0.1:1587:587']
volumes:
- ./.tmp/opendkim-keys:/mnt/opendkim-keys:ro
- ./.tmp/postfix-queue:/var/spool/postfix
environment:
TZ: UTC
<<: [*logging, *x-disable-ipv6, *x-dns]
healthcheck:
disable: true
networks:
net:
ipv4_address: 10.5.5.9
smtp-in:
depends_on:
logger:
condition: service_healthy
resolver:
condition: service_healthy
container_name: smtp-in
hostname: smtp-in
image: smtp-in
ports: ['25:25']
restart: always
volumes:
- ./.tmp/certbot/conf/live/feedsubscription.com/fullchain.pem:/etc/postfix/cert/smtp.cert:ro
- ./.tmp/certbot/conf/live/feedsubscription.com/privkey.pem:/etc/postfix/cert/smtp.key:ro
environment:
SMTP_IN_SASL_PASSWORD: ${SMTP_IN_SASL_PASSWORD?}
<<: [*logging, *x-disable-ipv6, *x-dns]
networks:
net:
ipv4_address: 10.5.5.8
postilion:
depends_on:
logger:
condition: service_healthy
resolver:
condition: service_healthy
container_name: postilion
hostname: postilion
image: postilion
restart: always
ports: ['587:587']
volumes:
- ./.tmp/opendkim-keys:/mnt/opendkim-keys:ro
- ./.tmp/postilion-queue:/var/spool/postfix
- ./.tmp/certbot/conf/live/feedsubscription.com/fullchain.pem:/etc/postfix/cert/smtp.cert:ro
- ./.tmp/certbot/conf/live/feedsubscription.com/privkey.pem:/etc/postfix/cert/smtp.key:ro
environment:
TZ: UTC
POSTILION_SASL_PASSWORD_GURDIGA_COM: ${POSTILION_SASL_PASSWORD_GURDIGA_COM?}
POSTILION_SASL_PASSWORD_SANDRADODD_COM: ${POSTILION_SASL_PASSWORD_SANDRADODD_COM?}
<<: [*logging, *x-disable-ipv6, *x-dns]
networks:
net:
ipv4_address: 10.5.5.10
app:
depends_on:
logger:
condition: service_healthy
resolver:
condition: service_healthy
container_name: app
hostname: app
image: app
init: true # This is to tell Node process to stop when the container is asked to stop.
restart: always
volumes:
- ${DATA_DIR_ROOT?}:/data
# NOTE: This doesn’t work, and I’m not fixing it now because I don’t
# know how, and it’s not worth the effort of further investigation.
# extra_hosts:
# - 'feedsubscription.com:207.154.253.211'
environment:
<<: *app-env
command: node dist/app/cron.js
<<: [*logging, *x-disable-ipv6, *x-dns]
networks:
net:
ipv4_address: 10.5.5.7
delmon:
depends_on:
logger:
condition: service_healthy
resolver:
condition: service_healthy
container_name: delmon
hostname: delmon
image: app
init: true # This is to tell Node process to stop when the container is asked to stop.
restart: always
# Doubled $$ so Compose passes the guard into the container instead of
# resolving it against the host environment at parse time.
command: sh -c 'tail -n 0 -F "$${SMTP_OUT_LOG:?SMTP_OUT_LOG is not set}" | node dist/app/delivery-monitoring'
volumes:
- .tmp/logs/feedsubscription:/logs:ro
- ${DATA_DIR_ROOT?}:/data
environment:
<<: *app-env
SMTP_OUT_LOG: /logs/smtp-out.log
<<: [*logging, *x-disable-ipv6, *x-dns]
networks:
net:
ipv4_address: 10.5.5.6
api:
depends_on:
logger:
condition: service_healthy
resolver:
condition: service_healthy
container_name: api
hostname: api
image: app
init: true # This is to tell Node process to stop when the container is asked to stop.
restart: always
command: node dist/api/server.js
volumes:
- ${DATA_DIR_ROOT?}:/data
environment:
# DEBUG: 'express:*'
# TS_NODE_DEBUG: 'true'
<<: *app-env
<<: [*logging, *x-disable-ipv6, *x-dns]
networks:
net:
ipv4_address: 10.5.5.5
# Thanks to https://github.com/wmnnd/nginx-certbot
website:
depends_on: [api]
container_name: website
hostname: website
image: website
restart: always
ports: ['80:80', '443:443']
volumes:
- ./website/html:/usr/share/nginx/html:ro
- ./website/nginx/conf.d:/etc/nginx/conf.d:ro
- ./.tmp/nginx-blocklists:/etc/nginx/blocklists:ro
- ./.tmp/certbot/conf:/etc/letsencrypt
- ./.tmp/certbot/www:/var/www/certbot
environment:
NGINX_HOST: feedsubscription.com
<<: [*logging, *x-disable-ipv6, *x-dns]
networks:
net:
ipv4_address: 10.5.5.4
# Thanks to https://github.com/wmnnd/nginx-certbot
certbot:
depends_on:
logger:
condition: service_healthy
resolver:
condition: service_healthy
container_name: certbot
hostname: certbot
image: certbot
restart: always
volumes:
- ./.tmp/certbot/conf:/etc/letsencrypt
- ./website/html:/var/www/certbot
entrypoint: >-
/bin/sh -c '
certbot --version;
exec crond -f -d 8;
'
<<: [*logging, *x-disable-ipv6, *x-dns]
networks:
net:
ipv4_address: 10.5.5.3
logger:
container_name: logger
hostname: logger
image: logger
restart: always
volumes:
- ./.tmp/logs:/var/log/syslog-ng
<<: [*x-dns]
healthcheck:
test: ['CMD-SHELL', 'nc -z -w1 10.5.5.1 514']
interval: 5s
timeout: 3s
retries: 2
networks:
net:
ipv4_address: 10.5.5.1
resolver:
depends_on:
logger:
condition: service_healthy
hostname: resolver
image: resolver
container_name: resolver
restart: always
volumes:
- ./.tmp/resolver/etc/hosts:/etc/hosts:ro
networks:
net:
ipv4_address: 10.5.5.2
<<: [*logging, *x-disable-ipv6]
healthcheck:
test: ['CMD-SHELL', 'pidof dnsmasq >/dev/null']
interval: 5s
timeout: 3s
retries: 2
networks:
net:
enable_ipv6: false # Trying to simplify the DNS issue context
driver: bridge
ipam:
config:
- subnet: 10.5.5.0/24
gateway: 10.5.5.100