This repository has been archived by the owner on Apr 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
docker-compose-base.yml
424 lines (348 loc) · 12.2 KB
/
docker-compose-base.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
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
# ------------------------------------------------------------------------------
# Base settings for these containers:
#
# * Databases + Minio + Keycloak + NGINX containers (use same settings in all files)
# * Aether Kernel
# * Entity Extractor
# * ODK Module
# * Aether UI & UI Assets
# * Zookeeper & Kafka
# * Aether Kafka Producer
#
# These container will be extended in the other DC files with dependencies and networks.
# Volumes and environment variables can be overridden in those files too.
# See more in: https://docs.docker.com/compose/extends/
# ------------------------------------------------------------------------------
services:
# ---------------------------------
# Auxiliary containers
# ---------------------------------
postgres-base:
image: postgres:15-alpine
environment:
PGUSER: postgres
POSTGRES_HOST_AUTH_METHOD: trust
healthcheck:
test: pg_isready
interval: 2s
timeout: 3s
retries: 30
redis-base:
image: redis:alpine
command: >
redis-server
--requirepass ${REDIS_PASSWORD}
--notify-keyspace-events KEA
--appendonly yes
--auto-aof-rewrite-percentage 100
--auto-aof-rewrite-min-size 64mb
healthcheck:
test: redis-cli ping
interval: 2s
timeout: 3s
retries: 30
nginx-base:
image: nginx:alpine
volumes:
# local setup
- ./local-setup/nginx/nginx.conf:/etc/nginx/nginx.conf
- ./local-setup/nginx/sites-enabled:/etc/nginx/sites-enabled
# nginx log files
- ./.persistent_data/nginx:/var/log/nginx
# static folders per container
- ./.persistent_data/static:/static
ports:
- 80:80
extra_hosts:
- ${NETWORK_DOMAIN}:127.0.0.1
healthcheck:
test: nginx -t
interval: 5s
timeout: 3s
retries: 30
minio-base:
image: minio/minio:latest
volumes:
- ./.persistent_data/media:/data
environment:
MINIO_ACCESS_KEY: ${MINIO_STORAGE_ACCESS_KEY}
MINIO_SECRET_KEY: ${MINIO_STORAGE_SECRET_KEY}
command: minio server --quiet --address minio:9090 /data
keycloak-base:
image: jboss/keycloak:${KEYCLOAK_VERSION:-latest}
environment:
DB_VENDOR: POSTGRES
DB_ADDR: db
DB_DATABASE: keycloak
DB_USER: keycloak
DB_PASSWORD: ${KEYCLOAK_DB_PASSWORD}
KEYCLOAK_USER: ${KEYCLOAK_ADMIN_USERNAME}
KEYCLOAK_PASSWORD: ${KEYCLOAK_ADMIN_PASSWORD}
# ---------------------------------
# Aether Kernel
# ---------------------------------
kernel-base:
image: aether-kernel
build: ./aether-kernel
stdin_open: true
tty: true
environment:
CSRF_COOKIE_DOMAIN: ${NETWORK_DOMAIN}
DJANGO_SECRET_KEY: ${KERNEL_DJANGO_SECRET_KEY}
LOGGING_FORMATTER: verbose
LOGGING_LEVEL: ${LOGGING_LEVEL:-ERROR}
HTML_SELECT_CUTOFF: 10
PROFILING_ENABLED: ${ENABLE_PROFILING}
KEYCLOAK_SERVER_URL: ${KEYCLOAK_SERVER_URL}
KEYCLOAK_CLIENT_ID: ${KEYCLOAK_AETHER_CLIENT}
KEYCLOAK_BEHIND_SCENES: ${KEYCLOAK_BEHIND_SCENES}
MULTITENANCY: ${MULTITENANCY}
DEFAULT_REALM: ${DEFAULT_REALM}
REALM_COOKIE: ${REALM_COOKIE}
BUCKET_NAME: kernel
DJANGO_STORAGE_BACKEND: minio
MINIO_STORAGE_ACCESS_KEY: ${MINIO_STORAGE_ACCESS_KEY}
MINIO_STORAGE_SECRET_KEY: ${MINIO_STORAGE_SECRET_KEY}
MINIO_STORAGE_ENDPOINT: minio:9090
MINIO_STORAGE_MEDIA_URL: http://minio:9090/kernel
MINIO_STORAGE_AUTO_CREATE_MEDIA_BUCKET: "true"
MINIO_STORAGE_AUTO_CREATE_MEDIA_POLICY: "true"
APP_NAME: Aether Kernel
APP_URL: /kernel
STATIC_URL: /static/kernel/
ADMIN_USERNAME: ${KERNEL_ADMIN_USERNAME}
ADMIN_PASSWORD: ${KERNEL_ADMIN_PASSWORD}
ADMIN_TOKEN: ${KERNEL_ADMIN_TOKEN}
DB_NAME: aether
PGHOST: db
PGPASSWORD: ${KERNEL_DB_PASSWORD}
PGPORT: 5432
PGUSER: postgres
ENABLE_CONNECTION_POOL: ${ENABLE_DB_POOL}
DB_POOL_INTERNAL: ${ENABLE_DB_POOL}
DJANGO_USE_CACHE: ${ENABLE_CACHE}
REDIS_DJANGO_CACHE: ${ENABLE_CACHE}
REDIS_SESSION_CACHE: ${ENABLE_CACHE}
REDIS_HOST: redis
REDIS_PASSWORD: ${REDIS_PASSWORD}
REDIS_PORT: 6379
REDIS_DB: 0
REDIS_DB_CACHEOPS: 1
REDIS_DB_DJANGO: 2
REDIS_DB_SESSION: 3
EXPORT_CSV_ESCAPE: "\\"
EXPORT_CSV_QUOTES: "\""
EXPORT_CSV_SEPARATOR: ","
EXPORT_DATA_FORMAT: split
EXPORT_HEADER_CONTENT: labels
EXPORT_HEADER_SEPARATOR: /
EXPORT_HEADER_SHORTEN: "no"
WRITE_ENTITIES_TO_REDIS: ${WRITE_ENTITIES_TO_REDIS}
WEB_SERVER_PORT: 8100
PYTHONPYCACHEPREFIX: "/var/tmp/cache/cpython/"
volumes:
- ./aether-kernel:/code
# -------------------------------------------------------------
# to speed up SDK development changes
# - ${SDK_PATH:-../aether-django-sdk-library}/aether/sdk:/var/run/aether/venv/lib/python3.8/site-packages/aether/sdk
# to speed up Aether Python Library development changes
# - ${AETHER_PYTHON_PATH:-../aether-python-library}/aether/python:/var/run/aether/venv/lib/python3.8/site-packages/aether/python
command: start_dev
# ---------------------------------
# Entity Extractor
# ---------------------------------
exm-base:
image: aether-exm
build: ./aether-entity-extraction-module
stdin_open: true
tty: true
environment:
LOGGING_LEVEL: ${LOGGING_LEVEL:-ERROR}
DEFAULT_REALM: ${DEFAULT_REALM}
REALM_COOKIE: ${REALM_COOKIE}
# use internal url, this happens behind the curtains
AETHER_KERNEL_URL: http://kernel:8100/kernel
AETHER_KERNEL_TOKEN: ${KERNEL_ADMIN_TOKEN}
REDIS_DB: 0
REDIS_HOST: redis
REDIS_PASSWORD: ${REDIS_PASSWORD}
REDIS_PORT: 6379
PYTHONPYCACHEPREFIX: "/var/tmp/cache/cpython/"
volumes:
- ./aether-entity-extraction-module:/code
# to speed up Aether Python Library development changes
# - ${AETHER_PYTHON_PATH:-../aether-python-library}/aether/python:/var/run/aether/venv/lib/python3.8/site-packages/aether/python
command: start
# ---------------------------------
# ODK module
# ---------------------------------
odk-base:
image: aether-odk
build: ./aether-odk-module
stdin_open: true
tty: true
environment:
CSRF_COOKIE_DOMAIN: ${NETWORK_DOMAIN}
DJANGO_SECRET_KEY: ${ODK_DJANGO_SECRET_KEY}
LOGGING_FORMATTER: verbose
LOGGING_LEVEL: ${LOGGING_LEVEL:-ERROR}
HTML_SELECT_CUTOFF: 10
PROFILING_ENABLED: ${ENABLE_PROFILING}
KEYCLOAK_SERVER_URL: ${KEYCLOAK_SERVER_URL}
KEYCLOAK_CLIENT_ID: ${KEYCLOAK_AETHER_CLIENT}
KEYCLOAK_BEHIND_SCENES: ${KEYCLOAK_BEHIND_SCENES}
MULTITENANCY: ${MULTITENANCY}
DEFAULT_REALM: ${DEFAULT_REALM}
REALM_COOKIE: ${REALM_COOKIE}
BUCKET_NAME: odk
DJANGO_STORAGE_BACKEND: minio
MINIO_STORAGE_ACCESS_KEY: ${MINIO_STORAGE_ACCESS_KEY}
MINIO_STORAGE_SECRET_KEY: ${MINIO_STORAGE_SECRET_KEY}
MINIO_STORAGE_ENDPOINT: minio:9090
MINIO_STORAGE_MEDIA_URL: http://minio:9090/odk
MINIO_STORAGE_AUTO_CREATE_MEDIA_BUCKET: "true"
MINIO_STORAGE_AUTO_CREATE_MEDIA_POLICY: "true"
APP_NAME: Aether ODK
APP_URL: /odk
STATIC_URL: /static/odk/
ADMIN_USERNAME: ${ODK_ADMIN_USERNAME}
ADMIN_PASSWORD: ${ODK_ADMIN_PASSWORD}
ADMIN_TOKEN: ${ODK_ADMIN_TOKEN}
AETHER_KERNEL_TOKEN: ${KERNEL_ADMIN_TOKEN}
AETHER_KERNEL_URL: http://${NETWORK_DOMAIN}/kernel
AETHER_KERNEL_URL_TEST: http://kernel-test:9100
DB_NAME: odk
PGHOST: db
PGPASSWORD: ${ODK_DB_PASSWORD}
PGPORT: 5432
PGUSER: postgres
ENABLE_CONNECTION_POOL: ${ENABLE_DB_POOL}
DB_POOL_INTERNAL: ${ENABLE_DB_POOL}
DJANGO_USE_CACHE: ${ENABLE_CACHE}
REDIS_DJANGO_CACHE: ${ENABLE_CACHE}
REDIS_SESSION_CACHE: ${ENABLE_CACHE}
REDIS_HOST: redis
REDIS_PASSWORD: ${REDIS_PASSWORD}
REDIS_PORT: 6379
REDIS_DB: 4
REDIS_DB_CACHEOPS: 5
REDIS_DB_DJANGO: 6
REDIS_DB_SESSION: 7
WEB_SERVER_PORT: 8102
PYTHONPYCACHEPREFIX: "/var/tmp/cache/cpython/"
volumes:
- ./aether-odk-module:/code
# -------------------------------------------------------------
# to speed up SDK development changes
# - ${SDK_PATH:-../aether-django-sdk-library}/aether/sdk:/var/run/aether/venv/lib/python3.8/site-packages/aether/sdk
command: start_dev
# ---------------------------------
# Aether UI
# ---------------------------------
ui-base:
image: aether-ui
build: ./aether-ui
stdin_open: true
tty: true
environment:
CSRF_COOKIE_DOMAIN: ${NETWORK_DOMAIN}
DJANGO_SECRET_KEY: ${UI_DJANGO_SECRET_KEY}
LOGGING_FORMATTER: verbose
LOGGING_LEVEL: ${LOGGING_LEVEL:-ERROR}
HTML_SELECT_CUTOFF: 10
PROFILING_ENABLED: ${ENABLE_PROFILING}
KEYCLOAK_SERVER_URL: ${KEYCLOAK_SERVER_URL}
KEYCLOAK_CLIENT_ID: ${KEYCLOAK_AETHER_CLIENT}
KEYCLOAK_BEHIND_SCENES: ${KEYCLOAK_BEHIND_SCENES}
MULTITENANCY: ${MULTITENANCY}
DEFAULT_REALM: ${DEFAULT_REALM}
REALM_COOKIE: ${REALM_COOKIE}
APP_NAME: Aether
STATIC_URL: /static/ui/
ADMIN_USERNAME: ${UI_ADMIN_USERNAME}
ADMIN_PASSWORD: ${UI_ADMIN_PASSWORD}
AETHER_KERNEL_TOKEN: ${KERNEL_ADMIN_TOKEN}
AETHER_KERNEL_URL: http://${NETWORK_DOMAIN}/kernel
AETHER_KERNEL_URL_TEST: http://kernel-test:9100
DB_NAME: ui
PGHOST: db
PGPASSWORD: ${UI_DB_PASSWORD}
PGPORT: 5432
PGUSER: postgres
ENABLE_CONNECTION_POOL: ${ENABLE_DB_POOL}
DB_POOL_INTERNAL: ${ENABLE_DB_POOL}
DJANGO_USE_CACHE: ${ENABLE_CACHE}
REDIS_DJANGO_CACHE: ${ENABLE_CACHE}
REDIS_SESSION_CACHE: ${ENABLE_CACHE}
REDIS_HOST: redis
REDIS_PASSWORD: ${REDIS_PASSWORD}
REDIS_PORT: 6379
REDIS_DB: 8
REDIS_DB_CACHEOPS: 9
REDIS_DB_DJANGO: 10
REDIS_DB_SESSION: 11
# use this value with "start_dev" command and webpack otherwise comment it out
WEBPACK_STATS_FILE: /code/aether/ui/assets/bundles/webpack-stats.json
WEB_SERVER_PORT: 8104
PYTHONPYCACHEPREFIX: "/var/tmp/cache/cpython/"
volumes:
- ./aether-ui:/code
# -------------------------------------------------------------
# to speed up SDK development changes
# - ${SDK_PATH:-../aether-django-sdk-library}/aether/sdk:/var/run/aether/venv/lib/python3.8/site-packages/aether/sdk
command: start_dev
ui-assets-base:
image: aether-ui-assets
build: ./aether-ui/aether/ui/assets
stdin_open: true
tty: true
volumes:
- ./aether-ui/aether/ui/assets/:/code/assets
command: start_dev
# ---------------------------------
# Kafka & Zookeeper
# ---------------------------------
zookeeper-base:
image: confluentinc/cp-zookeeper:${CONFLUENTINC_VERSION:-latest}
environment:
ZOOKEEPER_CLIENT_PORT: 32181
ZOOKEEPER_TICK_TIME: 2000
kafka-base:
image: confluentinc/cp-kafka:${CONFLUENTINC_VERSION:-latest}
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:32181
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:29092
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
ADVERTISED_HOST_NAME: kafka
# ---------------------------------
# Aether Kafka Producer
# ---------------------------------
producer-base:
image: aether-producer
build: ./aether-producer
stdin_open: true
environment:
PYTHONUNBUFFERED: 1
LOG_LEVEL: ${LOGGING_LEVEL:-ERROR}
PRODUCER_ADMIN_USER: ${PRODUCER_ADMIN_USER}
PRODUCER_ADMIN_PW: ${PRODUCER_ADMIN_PW}
# These variables will override the ones indicated in the settings file
AETHER_KERNEL_TOKEN: ${KERNEL_ADMIN_TOKEN}
AETHER_KERNEL_URL: http://kernel:8100/kernel
DEFAULT_REALM: ${DEFAULT_REALM}
REALM_COOKIE: ${REALM_COOKIE}
POSTGRES_HOST: db
POSTGRES_DBNAME: aether
POSTGRES_USER: postgres
POSTGRES_PORT: 5432
POSTGRES_PASSWORD: ${KERNEL_DB_PASSWORD}
OFFSET_DB_HOST: db
OFFSET_DB_USER: postgres
OFFSET_DB_PORT: 5432
OFFSET_DB_PASSWORD: ${PRODUCER_DB_PASSWORD}
OFFSET_DB_NAME: producer_offset_db
PYTHONPYCACHEPREFIX: "/var/tmp/cache/cpython/"
volumes:
- ./aether-producer:/code
command: start