-
Notifications
You must be signed in to change notification settings - Fork 0
/
btp-and-proxy.yml
271 lines (252 loc) · 6.2 KB
/
btp-and-proxy.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
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
version: '3.9'
networks:
proxy:
driver: bridge
driver_opts:
com.docker.network.driver.mtu: 1420
pelias:
driver: bridge
driver_opts:
com.docker.network.driver.mtu: 1420
services:
#
# BACKGROUND MAP
#
tileserver-gl:
logging:
driver: json-file
options:
max-size: '10m'
max-file: '1'
image: ${IMAGE_TILESERVER_GL:?}
restart: unless-stopped
environment:
VIRTUAL_PORT: 8080
VIRTUAL_HOST: ${DOMAIN_TILESERVER_GL:?}
LETSENCRYPT_HOST: ${DOMAIN_TILESERVER_GL:?}
networks:
- proxy
#
# ROUTING
#
opentripplanner:
logging:
driver: json-file
options:
max-size: '10m'
max-file: '1'
image: ${IMAGE_OPENTRIPPLANNER:?}
restart: unless-stopped
environment:
VIRTUAL_PORT: 8080
VIRTUAL_HOST: ${DOMAIN_OPENTRIPPLANNER:?}
LETSENCRYPT_HOST: ${DOMAIN_OPENTRIPPLANNER:?}
networks:
- proxy
#
# GEOCODER
#
api:
logging:
driver: json-file
options:
max-size: '10m'
max-file: '1'
image: ${IMAGE_PELIAS_API:?}
restart: unless-stopped
environment:
VIRTUAL_PORT: 4000
VIRTUAL_HOST: ${DOMAIN_API:?}
LETSENCRYPT_HOST: ${DOMAIN_API:?}
networks:
- proxy
- pelias
depends_on:
libpostal:
condition: service_healthy
placeholder:
condition: service_healthy
interpolation:
condition: service_healthy
pip:
condition: service_healthy
elasticsearch:
condition: service_healthy
libpostal:
logging:
driver: json-file
options:
max-size: '10m'
max-file: '1'
image: ${IMAGE_PELIAS_LIBPOSTAL:?}
restart: unless-stopped
networks:
- pelias
placeholder:
logging:
driver: json-file
options:
max-size: '10m'
max-file: '1'
image: ${IMAGE_PELIAS_PLACEHOLDER:?}
restart: unless-stopped
networks:
- pelias
interpolation:
logging:
driver: json-file
options:
max-size: '10m'
max-file: '1'
image: ${IMAGE_PELIAS_INTERPOLATION:?}
restart: unless-stopped
networks:
- pelias
pip:
logging:
driver: json-file
options:
max-size: '10m'
max-file: '1'
image: ${IMAGE_PELIAS_PIP:?}
restart: unless-stopped
networks:
- pelias
elasticsearch:
logging:
driver: json-file
options:
max-size: '10m'
max-file: '1'
image: ${IMAGE_PELIAS_ELASTICSEARCH:?}
restart: unless-stopped
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536
hard: 65536
cap_add: [ "IPC_LOCK" ]
security_opt:
- seccomp=unconfined
networks:
- pelias
#
# WEB UI
#
digitransit-ui:
logging:
driver: json-file
options:
max-size: '10m'
max-file: '1'
image: ${IMAGE_DIGITRANSIT_UI:?}
environment:
OTP_URL: https://${DOMAIN_OPENTRIPPLANNER:?}/otp/routers/default/
GEOCODING_BASE_URL: https://${DOMAIN_API:?}/v1
DEFAULT_MAP_URL: https://${DOMAIN_TILESERVER_GL:?}/styles/bicycle/
STOP_MAP_URL: https://${DOMAIN_OPENTRIPPLANNER:?}/otp/routers/default/vectorTiles/stops,stations/
#
VIRTUAL_PORT: 8080
VIRTUAL_HOST: ${DOMAIN_DIGITRANSIT_UI:?}
LETSENCRYPT_HOST: ${DOMAIN_DIGITRANSIT_UI:?}
networks:
- proxy
depends_on:
tileserver-gl:
condition: service_healthy
api:
condition: service_healthy
opentripplanner:
condition: service_healthy
#
# REVERSE PROXY & CERTIFICATES
#
nginx-proxy:
logging:
driver: json-file
options:
max-size: '10m'
max-file: '1'
image: nginx:stable-alpine
restart: unless-stopped
ports:
- '0.0.0.0:80:80'
- '0.0.0.0:443:443'
# - '::0:80:80' # IPv6
# - '::0:443:443' # IPv6
environment:
SSL_POLICY: Mozilla-Modern
# ENABLE_IPV6: true
TRUST_DOWNSTREAM_PROXY: false
volumes:
- ./private/conf.d:/etc/nginx/conf.d
- ./private/vhost.d:/etc/nginx/vhost.d
- ./private/html:/usr/share/nginx/html
- ./private/certs:/etc/nginx/certs:ro
- ./private/httpasswd:/etc/nginx/htpasswd:ro
labels:
- 'com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy'
networks:
- proxy
docker-gen:
logging:
driver: json-file
options:
max-size: '10m'
max-file: '1'
# nginxproxy/docker-gen:latest with added nginx.tmpl
image: p1st/docker-gen:latest
command: -notify-sighup nginx-proxy -watch -wait 5s:30s /etc/docker-gen/templates/nginx.tmpl /etc/nginx/conf.d/default.conf
restart: unless-stopped
volumes:
- ./private/conf.d:/etc/nginx/conf.d
- ./private/vhost.d:/etc/nginx/vhost.d
- ./private/html:/usr/share/nginx/html
- ./private/certs:/etc/nginx/certs:ro
- ./private/httpasswd:/etc/nginx/htpasswd:ro
#
- /var/run/docker.sock:/tmp/docker.sock:ro
labels:
- 'com.github.jrcs.letsencrypt_nginx_proxy_companion.docker_gen'
networks:
- proxy
acme-companion:
logging:
driver: json-file
options:
max-size: '10m'
max-file: '1'
image: nginxproxy/acme-companion
restart: unless-stopped
environment:
DEFAULT_EMAIL: ${LETS_ENCRYPT_NOTIFICATION_EMAIL:?}
volumes:
- ./private/conf.d:/etc/nginx/conf.d
- ./private/vhost.d:/etc/nginx/vhost.d
- ./private/html:/usr/share/nginx/html
- ./private/certs:/etc/nginx/certs:rw
#
- ./private/acme.sh:/etc/acme.sh
- /var/run/docker.sock:/var/run/docker.sock:ro
networks:
- proxy
depends_on:
- nginx-proxy
- docker-gen
#
# PERIODICALLY DELETE LOG FILES
#
# They contain personal information such as IP addresses.
#
docker_cron_logging:
image: busybox
volumes:
- /mnt/data/docker/containers:/docker-containers
# Daily at 04:30: Truncate docker logfiles.
command: >
sh -c "
mkdir -p /var/spool/cron/crontabs/
&& echo '30 4 * * * truncate -s 0 /docker-containers/*/*-json.log > /proc/1/fd/1 2>/proc/1/fd/2' > /var/spool/cron/crontabs/root
&& crond -f -d 8"