-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathdocker-compose.yml
346 lines (344 loc) · 10.9 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
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
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
services:
webclient:
image: ghcr.io/tum-dev/navigatum-webclient:main
restart: unless-stopped
labels:
- "traefik.enable=true"
- "traefik.http.routers.navigatum-webclient.entrypoints=webs"
- "traefik.http.routers.navigatum-webclient.tls.certresolver=leacme"
- "traefik.http.routers.navigatum-webclient.rule=Host(`nav.tum.de`)"
- "traefik.http.services.navigatum-webclient.loadbalancer.server.port=3000"
networks:
- traefik_traefik
expose:
- "3000"
environment:
TZ: Europe/Berlin
NUXT_PUBLIC_CDN_URL: https://nav.tum.de
NUXT_PUBLIC_API_URL: https://nav.tum.de
# cdn
data:
image: ghcr.io/tum-dev/navigatum-data:main
restart: unless-stopped
labels:
- "traefik.enable=true"
- "traefik.http.routers.navigatum-data.entrypoints=webs"
- "traefik.http.routers.navigatum-data.tls.certresolver=leacme"
- "traefik.http.routers.navigatum-data.rule=Host(`nav.tum.de`) && PathPrefix(`/cdn/`)"
- "traefik.http.services.navigatum-data.loadbalancer.server.port=3002"
networks:
- traefik_traefik
environment:
TZ: Europe/Berlin
expose:
- "3002"
server:
image: ghcr.io/tum-dev/navigatum-server:main
restart: unless-stopped
labels:
- "traefik.enable=true"
- "traefik.http.routers.navigatum-server.entrypoints=webs"
- "traefik.http.routers.navigatum-server.tls.certresolver=leacme"
- "traefik.http.routers.navigatum-server.rule=Host(`nav.tum.de`) && PathPrefix(`/api`)"
- "traefik.http.services.navigatum-server.loadbalancer.server.port=3003"
networks:
- traefik_traefik
expose:
- "3003"
command: /bin/navigatum-server
user: 1000:3000
environment:
TZ: Europe/Berlin
LOG_LEVEL: ${LOG_LEVEL-info}
MIELI_URL: http://meilisearch:7700
MEILI_MASTER_KEY: ${MEILI_MASTER_KEY}
CDN_URL: http://data:3002/cdn
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_URL: db:5432
CONNECTUM_OAUTH_CLIENT_ID: ${CONNECTUM_OAUTH_CLIENT_ID}
CONNECTUM_OAUTH_CLIENT_SECRET: ${CONNECTUM_OAUTH_CLIENT_SECRET}
GITHUB_TOKEN: ${GITHUB_TOKEN}
JWT_KEY: ${JWT_KEY}
depends_on:
meilisearch:
condition: service_healthy
osm2pgsql-init:
condition: service_started
db:
condition: service_healthy
meilisearch:
image: getmeili/meilisearch:v1.12.7
restart: unless-stopped
networks:
- traefik_traefik
expose:
- "7700"
environment:
TZ: Europe/Berlin
MEILI_MASTER_KEY: ${MEILI_MASTER_KEY}
MEILI_ENV: production
healthcheck:
test: curl --silent http://localhost:7700/health
retries: 5
interval: 10s
start_period: 10s
start_interval: 500ms
db:
image: postgis/postgis:17-3.4
restart: unless-stopped
environment:
TZ: Europe/Berlin
PGDATA: /var/lib/postgresql/data/pgdata
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_DB: ${POSTGRES_DB}
command:
- -c
- synchronous_commit=off
networks:
- traefik_traefik
expose:
- "5432"
volumes:
- postgis-data:/var/lib/postgresql/data
- ./resources/init-db.sh:/docker-entrypoint-initdb.d/init-db.sh:ro
healthcheck:
test: [ "CMD", "pg_isready", "-U", "${POSTGRES_USER}" ]
retries: 5
interval: 10s
start_interval: 500ms
start_period: 20s
download-data:
image: alpine:latest
command: sh /map/download.sh europe/germany/bayern
environment:
TZ: Europe/Berlin
working_dir: /map
volumes:
- ./map/data/:/map/data/:rw
- ./map/gtfs_feeds/:/map/gtfs_feeds/:rw
- ./map/download.sh:/map/download.sh:ro
- ./map/valhalla.json:/map/valhalla.json:ro
valhalla:
image: ghcr.io/gis-ops/docker-valhalla/valhalla:latest
restart: unless-stopped
labels:
- "traefik.enable=true"
- "traefik.http.routers.navigatum-valhalla.entrypoints=webs"
- "traefik.http.routers.navigatum-valhalla.tls.certresolver=leacme"
- "traefik.http.routers.navigatum-valhalla.rule=Host(`nav.tum.de`) && PathPrefix(`/valhalla`)"
- "traefik.http.routers.navigatum-valhalla.middlewares=navigatum-valhalla-stripprefix@docker"
- "traefik.http.middlewares.navigatum-valhalla-stripprefix.stripprefix.prefixes=/valhalla"
- "traefik.http.services.navigatum-valhalla.loadbalancer.server.port=8002"
environment:
TZ: Europe/Berlin
networks:
- traefik_traefik
expose:
- 8002
volumes:
- ./map/data/:/custom_files:rw
tmpfs:
- /tmp
read_only: true
healthcheck:
test: curl --fail -s http://localhost:8002/status || exit 1
interval: 60s
retries: 2
start_period: 5s
start_interval: 500ms
timeout: 1s
nominatim:
image: mediagis/nominatim:4.5
restart: unless-stopped
networks:
- traefik_traefik
environment:
PBF_PATH: /map/data/bayern-latest.osm.pbf
REPLICATION_URL: https://download.geofabrik.de/europe/germany/bayern-updates/
UPDATE_MODE: continuous
IMPORT_WIKIPEDIA: true
IMPORT_STYLE: street
volumes:
- ./map/data/:/map/data/:ro
depends_on:
download-data:
condition: service_completed_successfully
expose:
- 8080
labels:
- "traefik.enable=true"
- "traefik.http.routers.navigatum-nominatim.entrypoints=webs"
- "traefik.http.routers.navigatum-nominatim.tls.certresolver=leacme"
- "traefik.http.routers.navigatum-nominatim.rule=Host(`nav.tum.de`) && PathPrefix(`/nominatim`)"
- "traefik.http.routers.navigatum-nominatim.middlewares=navigatum-nominatim-stripprefix@docker"
- "traefik.http.middlewares.navigatum-nominatim-stripprefix.stripprefix.prefixes=/nominatim"
- "traefik.http.services.navigatum-nominatim.loadbalancer.server.port=8080"
healthcheck:
test: curl --fail -s http://localhost:8080/status || exit 1
interval: 60s
retries: 2
start_period: 5s
start_interval: 500ms
timeout: 1s
osm2pgsql-init:
image: iboates/osm2pgsql:latest
networks:
- traefik_traefik
environment:
TZ: Europe/Berlin
PGPASSWORD: ${POSTGRES_PASSWORD}
command:
- osm2pgsql
- --create
- --slim
- --cache
- "4096" # cache size in MB, maybe too low for optimum
- --database
- ${POSTGRES_DB}
- --user
- ${POSTGRES_USER}
- --host
- db
- --port
- "5432"
- /map/data/bayern-latest.osm.pbf
- --output=flex
- --style
- /map/osm2pgsql/style.lua
volumes:
- ./map/data/:/map/data/:ro
- ./map/osm2pgsql/:/map/osm2pgsql/:ro
depends_on:
download-data:
condition: service_completed_successfully
db:
condition: service_healthy
osm2pgsql-replication-init:
image: iboates/osm2pgsql:latest
networks:
- traefik_traefik
environment:
TZ: Europe/Berlin
PGPASSWORD: ${POSTGRES_PASSWORD}
command:
- replication
- init
- --database
- ${POSTGRES_DB}
- --username
- ${POSTGRES_USER}
- --host
- db
- --port
- "5432"
depends_on:
osm2pgsql-init:
condition: service_completed_successfully
db:
condition: service_healthy
volumes:
- ./map/osm2pgsql/:/map/osm2pgsql/:ro
osm2pgsql-replication:
image: iboates/osm2pgsql:latest
networks:
- traefik_traefik
environment:
TZ: Europe/Berlin
PGPASSWORD: ${POSTGRES_PASSWORD}
command:
- replication
- update
- --database
- ${POSTGRES_DB}
- --username
- ${POSTGRES_USER}
- --host
- db
- --port
- "5432"
depends_on:
osm2pgsql-replication-init:
condition: service_completed_successfully
volumes:
- ./map/osm2pgsql/:/map/osm2pgsql/:ro
martin-init-config:
image: alpine:latest
command:
- /bin/sh
- /map/martin/setup.sh
environment:
TZ: Europe/Berlin
volumes:
- ./map/:/map/
martin:
image: ghcr.io/maplibre/martin:v0.15.0
restart: unless-stopped
command:
- --config
- /map/config.yaml
labels:
- "traefik.enable=true"
- "traefik.http.routers.navigatum-martin.entrypoints=webs"
- "traefik.http.routers.navigatum-martin.tls.certresolver=leacme"
- "traefik.http.routers.navigatum-martin.rule=Host(`nav.tum.de`) && PathPrefix(`/tiles`)"
- "traefik.http.routers.navigatum-martin.middlewares=navigatum-martin-stripprefix@docker"
- "traefik.http.middlewares.navigatum-martin-stripprefix.stripprefix.prefixes=/tiles"
- "traefik.http.middlewares.navigatum-martin-cache-headers.headers.customrequestheaders.Cache-Control=public, max-age=604800" # 7 days
- "traefik.http.services.navigatum-martin.loadbalancer.server.port=3001"
networks:
- traefik_traefik
expose:
- "3001"
environment:
TZ: Europe/Berlin
BASE_PATH: /tiles/
DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db/${POSTGRES_DB}
RUST_LOG: info
depends_on:
db:
condition: service_healthy
martin-init-config:
condition: service_completed_successfully
osm2pgsql-init:
condition: service_started
volumes:
- ./map/martin/:/map/:ro
- tileserver-src:/data:ro
healthcheck:
test: wget --spider http://0.0.0.0:3001/health || exit 1
retries: 10
interval: 1s
start_period: 1s
start_interval: 500ms
redirect-domain:
image: traefik/whoami:latest
restart: unless-stopped
labels:
- "traefik.enable=true"
- "traefik.http.routers.navigatum-redirect-domain.entrypoints=webs"
- "traefik.http.routers.navigatum-redirect-domain.tls.certresolver=leacme"
- "traefik.http.routers.navigatum-redirect-domain.rule=Host(`www.nav.tum.de`) || Host(`nav.tum.sexy`)"
- "traefik.http.routers.navigatum-redirect-domain.middlewares=navigatum-redirect-to-domain@docker"
- "traefik.http.middlewares.navigatum-redirect-to-domain.redirectregex.regex=^https://(www.)?nav.tum.(de|sexy)/(.*)"
- "traefik.http.middlewares.navigatum-redirect-to-domain.redirectregex.replacement=https://nav.tum.de/$${3}"
- "traefik.http.middlewares.navigatum-redirect-to-domain.redirectregex.permanent=true"
- "traefik.http.services.navigatum-redirect-domain.loadbalancer.server.port=80"
environment:
TZ: Europe/Berlin
healthcheck:
test: ["CMD", "/whoami", "--help"] # I know that this is not usefull. There does not exists a executable in that image that can call /health
retries: 2
interval: 10s
start_period: 10s
start_interval: 500ms
volumes:
tileserver-src:
driver: local
postgis-data:
driver: local
networks:
traefik_traefik:
external: true