forked from niwcpac/mole
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
408 lines (393 loc) · 15.7 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
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
version: '3.7'
services:
# This service for development use only
angular:
build: ./angular
ports:
- 4200:4200
volumes:
- angular_static_files:/home/node/dist
- ./angular/app/src:/home/node/mole_app/src:cached
- ./angular/app/e2e:/home/node/mole_app/e2e:cached
- ./angular/app/tsconfig.json:/home/node/mole_app/tsconfig.json
- ./angular/app/package.json:/home/node/mole_app/package.json
- ./angular/app/proxy.conf.js:/home/node/mole_app/proxy.conf.js
working_dir: /home/node/mole_app
entrypoint: ng serve --host 0.0.0.0 --public-host http://0.0.0.0/angular --poll 100
labels:
- traefik.enable=true
# Handle optional trailing slash on path prefix (e.g., /angular or /angular/)
# Taken from
# https://github.com/traefik/traefik/issues/5159#issuecomment-680086092 and
# https://github.com/traefik/traefik/issues/5159#issuecomment-679681822
- "traefik.http.middlewares.trailing-slash.chain.middlewares=slash-step1,slash-step2"
- "traefik.http.middlewares.slash-step1.redirectregex.regex=^(https?://[^/]+/[a-z0-9_]+)$$"
- "traefik.http.middlewares.slash-step1.redirectregex.replacement=$${1}/"
- "traefik.http.middlewares.slash-step1.redirectregex.permanent=true"
- "traefik.http.middlewares.slash-step2.stripprefixregex.regex=/[a-z0-9_]+"
# http
- "traefik.http.routers.angular.rule=PathPrefix(`/angular`)"
- "traefik.http.routers.angular.entrypoints=web"
- "traefik.http.services.angular.loadbalancer.server.port=4200"
- "traefik.http.routers.angular.service=angular"
- "traefik.http.routers.angular.middlewares=trailing-slash"
# https
- "traefik.http.routers.websecure-angular.rule=PathPrefix(`/angular`)"
- "traefik.http.routers.websecure-angular.entrypoints=websecure"
- "traefik.http.routers.websecure-angular.tls=true"
- "traefik.http.services.websecure-angular.loadbalancer.server.port=4200"
- "traefik.http.routers.websecure-angular.service=websecure-angular"
- "traefik.http.routers.websecure-angular.middlewares=trailing-slash"
proxy:
# The official v2 Traefik docker image
image: traefik:v2.4.8
# Enables the web UI and tells Traefik to listen to docker
command:
- --api.insecure=true
- --providers.docker
# - --log.level=DEBUG
- --entrypoints.web.address=:80
- --entrypoints.websecure.address=:443
- --providers.file.filename=/configuration/certs.yml
- --providers.file.watch=true
ports:
# The HTTP port
- "80:80"
# The HTTPS port
- "443:443"
# The Web UI (enabled by --api.insecure=true)
- "8080:8080"
volumes:
# So that Traefik can listen to the Docker events
- /var/run/docker.sock:/var/run/docker.sock
- ./traefik/certificates/:/certificates/
- ./traefik/configuration/certs.yml:/configuration/certs.yml
labels:
- traefik.enable=false
postgres:
image: postgis/postgis:11-3.0
ports:
- "5432:5432"
environment:
- POSTGRES_DB=${PGDATABASE}
- POSTGRES_USER=${PGUSER}
- POSTGRES_PASSWORD=${PGPASSWORD}
- PGDATABASE
- PGUSER
- PGPASSWORD
volumes:
- ./mole/build/postgresql.conf:/etc/postgresql/postgresql.conf
- ./db_backup/backups:/backups
command:
[
"postgres",
"-c",
"config_file=/etc/postgresql/postgresql.conf"
]
labels:
- traefik.enable=false
django:
init: true
volumes:
- ./mole:/home/django/mole
- angular_static_files:/angular_static
depends_on:
- redis
- postgres
build:
context: mole/.
args:
- "NEWUSERID"
- "BUILD_TAG"
- "LONG_BUILD_TAG"
environment:
- PGDATABASE
- PGUSER
- PGPASSWORD
- POPULATE_DB
- PROFILE
- BACKUP_FLAG
- PYTHONUNBUFFERED
- DEBUG_DJANGO
- PYTHONDONTWRITEBYTECODE=1
- TIMEZONE
entrypoint: build/init.sh
working_dir: /home/django/mole
ports:
- 8000:8000
- 5678:5678
labels:
- traefik.enable=true
- "traefik.http.middlewares.allpaths-stripprefix.stripprefix.prefixes=/login,/operator,/dashboard,/clock"
# http
- "traefik.http.routers.mole.rule=HostRegexp(`{domain:.*}`)||PathPrefix(`/login`,`/operator`,`/dashboard`,`/clock`)"
- "traefik.http.routers.mole.entrypoints=web"
- "traefik.http.routers.mole.priority=1"
- "traefik.http.services.mole.loadbalancer.server.port=8000"
- "traefik.http.routers.mole.service=mole"
- "traefik.http.routers.mole.middlewares=allpaths-stripprefix"
# https
- "traefik.http.routers.websecure-mole.rule=HostRegexp(`{domain:.*}`)||PathPrefix(`/login`,`/operator`,`/dashboard`,`/clock`)"
- "traefik.http.routers.websecure-mole.entrypoints=websecure"
- "traefik.http.routers.websecure-mole.tls=true"
- "traefik.http.routers.websecure-mole.priority=1"
- "traefik.http.services.websecure-mole.loadbalancer.server.port=8000"
- "traefik.http.routers.websecure-mole.service=websecure-mole"
- "traefik.http.routers.websecure-mole.middlewares=allpaths-stripprefix"
redis:
image: redis:latest
# ports:
# - "6379:6379"
volumes:
- redisdata:/data
labels:
- traefik.enable=false
docs:
build:
context: docs/.
args:
- "BUILD_TAG"
- "LONG_BUILD_TAG"
ports:
- "8001:8001"
# live reload adds significant CPU load. Disabling for default launching. It is still enabled for ./ml docs launching
command: [ "--no-livereload" ]
volumes:
- ./docs/raw:/docs/raw
labels:
- traefik.enable=true
# Handle optional trailing slash on path prefix (e.g., /docs or /docs/)
# Taken from
# https://github.com/traefik/traefik/issues/5159#issuecomment-680086092 and
# https://github.com/traefik/traefik/issues/5159#issuecomment-679681822
- "traefik.http.middlewares.trailing-slash.chain.middlewares=slash-step1,slash-step2"
- "traefik.http.middlewares.slash-step1.redirectregex.regex=^(https?://[^/]+/[a-z0-9_]+)$$"
- "traefik.http.middlewares.slash-step1.redirectregex.replacement=$${1}/"
- "traefik.http.middlewares.slash-step1.redirectregex.permanent=true"
- "traefik.http.middlewares.slash-step2.stripprefixregex.regex=/[a-z0-9_]+"
# http
- "traefik.http.routers.docs.rule=PathPrefix(`/docs`)"
- "traefik.http.routers.docs.entrypoints=web"
- "traefik.http.services.docs.loadbalancer.server.port=8001"
- "traefik.http.routers.docs.service=docs"
- "traefik.http.routers.docs.middlewares=trailing-slash"
# https
- "traefik.http.routers.websecure-docs.rule=PathPrefix(`/docs`)"
- "traefik.http.routers.websecure-docs.entrypoints=websecure"
- "traefik.http.routers.websecure-docs.tls=true"
- "traefik.http.services.websecure-docs.loadbalancer.server.port=8001"
- "traefik.http.routers.websecure-docs.service=websecure-docs"
- "traefik.http.routers.websecure-docs.middlewares=trailing-slash"
maptiles:
build: ./maps
ports:
- "8081:8080"
volumes:
- ./maps/maptiles:/data
# Note: we are patching the tileserver-gl code in our maps Dockerfile to allow releative public_url. See maps/resources/*.js
command: [ "--public_url", "/maps" ]
labels:
- traefik.enable=true
# Handle optional trailing slash on path prefix (e.g., /maps or /maps/)
# Taken from
# https://github.com/traefik/traefik/issues/5159#issuecomment-680086092 and
# https://github.com/traefik/traefik/issues/5159#issuecomment-679681822
- "traefik.http.middlewares.trailing-slash.chain.middlewares=slash-step1,slash-step2"
- "traefik.http.middlewares.slash-step1.redirectregex.regex=^(https?://[^/]+/[a-z0-9_]+)$$"
- "traefik.http.middlewares.slash-step1.redirectregex.replacement=$${1}/"
- "traefik.http.middlewares.slash-step1.redirectregex.permanent=true"
- "traefik.http.middlewares.slash-step2.stripprefixregex.regex=/[a-z0-9_]+"
# http
- "traefik.http.routers.maps.rule=PathPrefix(`/maps`)"
- "traefik.http.routers.maps.entrypoints=web"
- "traefik.http.services.maps.loadbalancer.server.port=8080"
- "traefik.http.routers.maps.service=maps"
- "traefik.http.routers.maps.middlewares=trailing-slash"
# https
- "traefik.http.routers.websecure-maps.rule=PathPrefix(`/maps`)"
- "traefik.http.routers.websecure-maps.entrypoints=websecure"
- "traefik.http.routers.websecure-maps.tls=true"
- "traefik.http.services.websecure-maps.loadbalancer.server.port=8080"
- "traefik.http.routers.websecure-maps.service=websecure-maps"
- "traefik.http.routers.websecure-maps.middlewares=trailing-slash"
report:
build:
context: report/.
args:
- "NEWUSERID"
- "BUILD_TAG"
- "LONG_BUILD_TAG"
ports:
- "8400:8400"
environment:
- PGDATABASE
- PGUSER
- PGPASSWORD
- TIMEZONE
- PYTHONUNBUFFERED=1
- PYTHONDONTWRITEBYTECODE=1
volumes:
- ./utilities:/utilities
# for dev only
- ./report:/app
entrypoint: build/init.sh
labels:
- traefik.enable=true
# Handle optional trailing slash on path prefix (e.g., /report or /report/)
# Taken from
# https://github.com/traefik/traefik/issues/5159#issuecomment-680086092 and
# https://github.com/traefik/traefik/issues/5159#issuecomment-679681822
- "traefik.http.middlewares.trailing-slash.chain.middlewares=slash-step1,slash-step2"
- "traefik.http.middlewares.slash-step1.redirectregex.regex=^(https?://[^/]+/[a-z0-9_]+)$$"
- "traefik.http.middlewares.slash-step1.redirectregex.replacement=$${1}/"
- "traefik.http.middlewares.slash-step1.redirectregex.permanent=true"
- "traefik.http.middlewares.slash-step2.stripprefixregex.regex=/[a-z0-9_]+"
# http
- "traefik.http.routers.report.rule=PathPrefix(`/report`)"
- "traefik.http.routers.report.entrypoints=web"
- "traefik.http.services.report.loadbalancer.server.port=8400"
- "traefik.http.routers.report.service=report"
- "traefik.http.routers.report.middlewares=trailing-slash"
# https
- "traefik.http.routers.websecure-report.rule=PathPrefix(`/report`)"
- "traefik.http.routers.websecure-report.entrypoints=websecure"
- "traefik.http.routers.websecure-report.tls=true"
- "traefik.http.services.websecure-report.loadbalancer.server.port=8400"
- "traefik.http.routers.websecure-report.service=websecure-report"
- "traefik.http.routers.websecure-report.middlewares=trailing-slash"
portainer:
image: portainer/portainer-ce:2.5.1
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./portainer/portainer-pass:/data/portainer-pass
- portainer_files:/data
ports:
- "8002:8000"
- "9000:9000"
entrypoint:
[
'/portainer',
'--admin-password-file',
'/data/portainer-pass',
'-H',
'unix:///var/run/docker.sock'
]
labels:
- traefik.enable=true
# Handle optional trailing slash on path prefix (e.g., /portainer or /portainer/)
# Taken from
# https://github.com/traefik/traefik/issues/5159#issuecomment-680086092 and
# https://github.com/traefik/traefik/issues/5159#issuecomment-679681822
- "traefik.http.middlewares.trailing-slash.chain.middlewares=slash-step1,slash-step2"
- "traefik.http.middlewares.slash-step1.redirectregex.regex=^(https?://[^/]+/[a-z0-9_]+)$$"
- "traefik.http.middlewares.slash-step1.redirectregex.replacement=$${1}/"
- "traefik.http.middlewares.slash-step1.redirectregex.permanent=true"
- "traefik.http.middlewares.slash-step2.stripprefixregex.regex=/[a-z0-9_]+"
# http
- "traefik.http.routers.portainer.rule=PathPrefix(`/portainer`)"
- "traefik.http.routers.portainer.entrypoints=web"
- "traefik.http.services.portainer.loadbalancer.server.port=9000"
- "traefik.http.routers.portainer.service=portainer"
- "traefik.http.routers.portainer.middlewares=trailing-slash"
# https
- "traefik.http.routers.websecure-portainer.rule=PathPrefix(`/portainer`)"
- "traefik.http.routers.websecure-portainer.entrypoints=websecure"
- "traefik.http.routers.websecure-portainer.tls=true"
- "traefik.http.services.websecure-portainer.loadbalancer.server.port=9000"
- "traefik.http.routers.websecure-portainer.service=websecure-portainer"
- "traefik.http.routers.websecure-portainer.middlewares=trailing-slash"
db_backup:
build:
context: db_backup/.
args:
- "NEWUSERID"
- "BUILD_TAG"
- "LONG_BUILD_TAG"
volumes:
- ./db_backup/backups:/backups
- ./mole/media/:/home/jobberuser/mole_media/
ports:
- "8003:8000"
environment:
# - TZ=America/New_York
- PGDATABASE
- PGUSER
- PGPASSWORD
- BACKUP_FLAG
- TIMEZONE
depends_on:
- postgres
labels:
- traefik.enable=true
# Handle optional trailing slash on path prefix (e.g., /db_backup or /db_backup/)
# Taken from
# https://github.com/traefik/traefik/issues/5159#issuecomment-680086092 and
# https://github.com/traefik/traefik/issues/5159#issuecomment-679681822
- "traefik.http.middlewares.trailing-slash.chain.middlewares=slash-step1,slash-step2"
- "traefik.http.middlewares.slash-step1.redirectregex.regex=^(https?://[^/]+/[a-z0-9_]+)$$"
- "traefik.http.middlewares.slash-step1.redirectregex.replacement=$${1}/"
- "traefik.http.middlewares.slash-step1.redirectregex.permanent=true"
- "traefik.http.middlewares.slash-step2.stripprefixregex.regex=/[a-z0-9_]+"
# http
- "traefik.http.routers.db_backup.rule=PathPrefix(`/db_backup`)"
- "traefik.http.routers.db_backup.entrypoints=web"
- "traefik.http.services.db_backup.loadbalancer.server.port=8000"
- "traefik.http.routers.db_backup.service=db_backup"
- "traefik.http.routers.db_backup.middlewares=trailing-slash"
# https
- "traefik.http.routers.websecure-db_backup.rule=PathPrefix(`/db_backup`)"
- "traefik.http.routers.websecure-db_backup.entrypoints=websecure"
- "traefik.http.routers.websecure-db_backup.tls=true"
- "traefik.http.services.websecure-db_backup.loadbalancer.server.port=8000"
- "traefik.http.routers.websecure-db_backup.service=websecure-db_backup"
- "traefik.http.routers.websecure-db_backup.middlewares=trailing-slash"
event_generator:
init: true
build:
context: event_generator/.
args:
- "BUILD_TAG"
- "LONG_BUILD_TAG"
depends_on:
- django
environment:
- PULSAR_IP
- DJANGO_IP
- REDIS_IP
- PYTHONUNBUFFERED
- PYTHONDONTWRITEBYTECODE=1
labels:
- "traefik.enable=false"
pulsar:
init: true
build: ./pulsar
ports:
- 6650:6650
- 8090:8080
environment:
- PYTHONDONTWRITEBYTECODE=1
- PYTHONUNBUFFERED=1
- INFLUXDB_IP
- INFLUXDB_PORT
- INFLUX_ORG
- INFLUX_TOKEN
- INFLUX_BUCKET
entrypoint: [ "/pulsar/scripts/start_pulsar.sh" ]
command: [ "bin/pulsar", "standalone", "-nss" ]
labels:
- "traefik.enable=false"
nifi:
build: ./nifi
container_name: nifi
ports:
- "8443:8443"
environment:
- SINGLE_USER_CREDENTIALS_USERNAME=admin
- SINGLE_USER_CREDENTIALS_PASSWORD=admindeveloper
volumes:
- ./nifi/extensions:/opt/nifi/nifi-current/extensions
# - ./nifi/flowfile_repository:/opt/nifi/nifi-current/flowfile_repository
volumes:
redisdata:
angular_static_files:
portainer_files: