-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
360 lines (339 loc) · 8.92 KB
/
Copy pathdocker-compose.yml
File metadata and controls
360 lines (339 loc) · 8.92 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
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
networks:
core:
airflow:
data_processing:
volumes:
postgres-airflow-volume:
airflow-plugins:
airflow-dags:
airflow-logs:
airflow-config:
airflow-sources:
core-postgres:
minio-data:
keycloak-postgres-data:
x-airflow-common:
&airflow-common
image: ${AIRFLOW_IMAGE_NAME:-apache/airflow:3.1.8}
environment:
&airflow-common-env
AIRFLOW__CORE__EXECUTOR: CeleryExecutor
AIRFLOW__CORE__AUTH_MANAGER: airflow.providers.fab.auth_manager.fab_auth_manager.FabAuthManager
AIRFLOW__DATABASE__SQL_ALCHEMY_CONN: postgresql+psycopg2://airflow:airflow@postgres-airflow/airflow
AIRFLOW__CELERY__RESULT_BACKEND: db+postgresql://airflow:airflow@postgres-airflow/airflow
AIRFLOW__CELERY__BROKER_URL: redis://:@redis-airflow:6379/0
AIRFLOW__CORE__FERNET_KEY: ''
AIRFLOW__CORE__DAGS_ARE_PAUSED_AT_CREATION: 'true'
AIRFLOW__CORE__LOAD_EXAMPLES: 'false'
AIRFLOW__CORE__EXECUTION_API_SERVER_URL: 'http://airflow-apiserver:8080/execution/'
AIRFLOW__SCHEDULER__ENABLE_HEALTH_CHECK: 'true'
AIRFLOW__SCHEDULER__DAG_DIR_LIST_INTERVAL: 0
AIRFLOW__SCHEDULER__MIN_FILE_PROCESS_INTERVAL: 0
_PIP_ADDITIONAL_REQUIREMENTS: ${_PIP_ADDITIONAL_REQUIREMENTS:-}
volumes:
- ./airflow-dags:/opt/airflow/dags
- airflow-logs:/opt/airflow/logs
- airflow-config:/opt/airflow/config
- airflow-plugins:/opt/airflow/plugins
- /var/run/docker.sock:/var/run/docker.sock
- ~/.docker:/root/.docker:ro
user: "0:0"
depends_on:
&airflow-common-depends-on
redis-airflow:
condition: service_healthy
postgres-airflow:
condition: service_healthy
services:
redis-airflow:
image: redis:7.2-bookworm
expose:
- 6379
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 30s
retries: 50
start_period: 30s
restart: always
networks:
- airflow
postgres-airflow:
image: postgres:14
environment:
POSTGRES_USER: airflow
POSTGRES_PASSWORD: airflow
POSTGRES_DB: airflow
volumes:
- postgres-airflow-volume:/var/lib/postgresql/data
healthcheck:
test: ["CMD", "pg_isready", "-U", "airflow"]
interval: 10s
retries: 5
start_period: 5s
restart: always
networks:
- airflow
airflow-init:
<<: *airflow-common
entrypoint: /bin/bash
command:
- -c
- |
mkdir -p /sources/logs /sources/dags /sources/plugins
chown -R "${AIRFLOW_UID}:0" /sources/{logs,dags,plugins}
exec /entrypoint airflow version
environment:
<<: *airflow-common-env
_AIRFLOW_DB_MIGRATE: 'true'
_AIRFLOW_WWW_USER_CREATE: 'true'
_AIRFLOW_WWW_USER_USERNAME: ${_AIRFLOW_WWW_USER_USERNAME:-airflow}
_AIRFLOW_WWW_USER_PASSWORD: ${_AIRFLOW_WWW_USER_PASSWORD:-airflow}
user: "0:0"
volumes:
- airflow-sources:/sources
networks:
- airflow
airflow-apiserver:
<<: *airflow-common
command: api-server
ports:
- "8080:8080"
healthcheck:
test: ["CMD", "curl", "--fail", "http://localhost:8080/api/v2/version"]
interval: 30s
timeout: 10s
retries: 5
start_period: 30s
restart: always
depends_on:
<<: *airflow-common-depends-on
airflow-init:
condition: service_completed_successfully
networks:
- airflow
- core
airflow-scheduler:
<<: *airflow-common
command: scheduler
healthcheck:
test: ["CMD", "curl", "--fail", "http://localhost:8974/health"]
interval: 30s
timeout: 10s
retries: 5
start_period: 30s
restart: always
depends_on:
<<: *airflow-common-depends-on
airflow-init:
condition: service_completed_successfully
networks:
- airflow
airflow-dag-processor:
<<: *airflow-common
command: dag-processor
healthcheck:
test: ["CMD-SHELL", 'airflow jobs check --job-type DagProcessorJob --hostname "$${HOSTNAME}"']
interval: 30s
timeout: 10s
retries: 5
start_period: 30s
restart: always
depends_on:
<<: *airflow-common-depends-on
airflow-init:
condition: service_completed_successfully
networks:
- airflow
airflow-worker:
<<: *airflow-common
command: celery worker
healthcheck:
test:
- "CMD-SHELL"
- 'celery --app airflow.providers.celery.executors.celery_executor.app inspect ping -d "celery@$${HOSTNAME}" || celery --app airflow.executors.celery_executor.app inspect ping -d "celery@$${HOSTNAME}"'
interval: 30s
timeout: 10s
retries: 5
start_period: 30s
environment:
<<: *airflow-common-env
DUMB_INIT_SETSID: "0"
restart: always
depends_on:
<<: *airflow-common-depends-on
airflow-apiserver:
condition: service_healthy
airflow-init:
condition: service_completed_successfully
networks:
- data_processing
- airflow
airflow-triggerer:
<<: *airflow-common
command: triggerer
healthcheck:
test: ["CMD-SHELL", 'airflow jobs check --job-type TriggererJob --hostname "$${HOSTNAME}"']
interval: 30s
timeout: 10s
retries: 5
start_period: 30s
restart: always
depends_on:
<<: *airflow-common-depends-on
airflow-init:
condition: service_completed_successfully
networks:
- airflow
airflow-cli:
<<: *airflow-common
profiles:
- debug
environment:
<<: *airflow-common-env
CONNECTION_CHECK_MAX_COUNT: "0"
command:
- bash
- -c
- airflow
networks:
- airflow
flower:
<<: *airflow-common
command: celery flower
profiles:
- flower
ports:
- "5555:5555"
healthcheck:
test: ["CMD", "curl", "--fail", "http://localhost:5555/"]
interval: 30s
timeout: 10s
retries: 5
start_period: 30s
restart: always
depends_on:
<<: *airflow-common-depends-on
airflow-init:
condition: service_completed_successfully
networks:
- airflow
### application:
frontend:
build: frontend
restart: always
ports:
- "8000:80"
environment:
NEXT_PUBLIC_OIDC_PROVIDER: http://localhost:8090,
NEXT_PUBLIC_CLIENT_ID: "scystream-frontend"
NEXT_PUBLIC_REDIRECT_URI: "http://localhost:8000"
NEXT_PUBLIC_POST_LOGOUT_REDIRECT_URI: "http://localhost:8000"
networks:
- core
core:
build: core
restart: always
ports:
- "4000:80"
environment:
SSH_AUTH_SOCK: /ssh-agent
EXTERNAL_URL: "http://localhost:8000"
AIRFLOW_HOST: "http://airflow-apiserver:8080/api/v1"
depends_on:
core-postgres:
condition: service_healthy
volumes:
- ./airflow-dags:/airflow-dags
- ${SSH_AUTH_SOCK}:/ssh-agent:ro
networks:
- core
- data_processing
core-postgres:
image: postgres:17
environment:
POSTGRES_USER: core
POSTGRES_PASSWORD: core
POSTGRES_DB: core
volumes:
- core-postgres:/var/lib/postgresql/data
restart: always
healthcheck:
test: ["CMD-SHELL", "pg_isready -U core -d core -q"]
interval: 10s
timeout: 2s
retries: 5
ports:
- "5432:5432"
networks:
- core
smtp:
image: reachfive/fake-smtp-server
networks:
- core
catapulte:
build: github.com/jdrouet/catapulte
environment:
LOG: debug
SMTP__HOSTNAME: smtp
SMTP__PORT: 1025
TEMPLATE__TYPE: local
TEMPLATE__PATH: /template
volumes:
- "./mail-template:/template:ro"
depends_on:
- smtp
networks:
- core
data-postgres:
image: postgres
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=postgres
networks:
- data_processing
data-minio:
image: quay.io/minio/minio
restart: always
environment:
- MINIO_ROOT_USER=minioadmin
- MINIO_ROOT_PASSWORD=minioadmin
volumes:
- minio-data:/data
ports:
- "9000:9000"
command: server /data --console-address ":9001"
networks:
- data_processing
keycloak-postgres:
image: postgres
volumes:
- "keycloak-postgres-data:/var/lib/postgresql/data"
environment:
POSTGRES_DB: "keycloak"
POSTGRES_USER: "keycloak"
POSTGRES_PASSWORD: "password"
keycloak:
image: quay.io/keycloak/keycloak
environment:
KC_DB: "postgres"
KC_DB_URL: "jdbc:postgresql://keycloak-postgres:5432/keycloak"
KC_DB_USERNAME: "keycloak"
KC_DB_PASSWORD: "password"
KC_HOSTNAME: "localhost"
KC_HOSTNAME_PORT: 8080
KC_HOSTNAME_STRICT: false
KC_HOSTNAME_STRICT_HTTPS: false
KC_LOG_LEVEL: "info"
KC_METRICS_ENABLED: true
KC_HEALTH_ENABLED: true
KEYCLOAK_ADMIN: "admin"
KEYCLOAK_ADMIN_PASSWORD: "admin"
command: start-dev --import-realm
ports:
- "8090:8080"
depends_on:
- keycloak-postgres
volumes:
- ./.keycloak-config:/opt/keycloak/data/import