-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathcompose.yml
More file actions
292 lines (275 loc) · 9.3 KB
/
compose.yml
File metadata and controls
292 lines (275 loc) · 9.3 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
include:
- compose.dev.yml
x-backend-common-envs: &backend-common-envs
DB_NAME: ${DB_NAME:?}
DB_USER: ${DB_USER:?}
DB_PASSWORD: ${DB_PASSWORD:?}
DB_PORT: 5432
DJANGO_ENV: DEV
DEBUG: "True"
DJANGO_MANAGEPY_MIGRATE: "off"
TZ: "UTC"
SECURE_COOKIES: "false"
USER_ASSOCIATION_TOKEN_SECRET_KEY: ${USER_ASSOCIATION_TOKEN_SECRET_KEY:?}
GUNICORN_CONFIGURATION: ${GUNICORN_CONFIGURATION}
EURYDICE_CONTACT: ${EURYDICE_CONTACT}
EURYDICE_CONTACT_FR: ${EURYDICE_CONTACT_FR}
UI_BADGE_CONTENT: ${UI_BADGE_CONTENT}
UI_BADGE_COLOR: ${UI_BADGE_COLOR}
LOG_TO_FILE: ${LOG_TO_FILE}
LOG_LEVEL: ${LOG_LEVEL}
PORT: 8080
x-backend: &backend
build:
context: backend
dockerfile: docker/Dockerfile
target: dev
image: eurydice/backend:dev
networks:
- eurydice
command:
- make
- run-dev
develop:
watch:
- action: rebuild
path: ./backend/uv.lock
- action: rebuild
path: ./backend/pyproject.toml
- action: rebuild
path: ./backend/docker/Dockerfile
- action: rebuild
path: ./backend/eurydice
- action: rebuild
path: ./backend/tests
x-frontend: &frontend
build:
context: frontend
dockerfile: docker/Dockerfile
target: dev
image: eurydice/frontend_dev:${EURYDICE_VERSION}
environment:
NODE_ENV: development
develop:
watch:
- action: sync
path: ./frontend
target: /home/abc/workdir
ignore:
- node_modules/
- action: rebuild
path: ./frontend/package-lock.json
- action: rebuild
path: ./frontend/docker/Dockerfile
x-common-origin-envs: &common-origin-envs
DB_HOST: db-origin
TRANSFERABLE_MAX_SIZE: 54975581388800
TRANSFERABLE_STORAGE_DIR: /tmp/eurydice-data/origin/
x-common-destination-envs: &common-destination-envs
DB_HOST: db-destination
TRANSFERABLE_STORAGE_DIR: /tmp/eurydice-data/destination/
x-common-auth-envs: &common-auth-envs
REMOTE_USER_HEADER_AUTHENTICATION_ENABLED: ${REMOTE_USER_HEADER_AUTHENTICATION_ENABLED}
services:
################ Origin Services ################
frontend-origin:
<<: *frontend
networks:
- eurydice
environment:
VITE_EURYDICE_GUICHET: origin
backend-origin:
<<: *backend
depends_on:
db-origin:
condition: service_started
volumes:
- ${PYTHON_LOGS_DIR:?}/backend-origin:/var/log/app
- ${ORIGIN_TRANSFERABLE_STORAGE_DIR:?}:/tmp/eurydice-data/origin
- ${PUBKEY_PATH:-/dev/null}:/home/eurydice/keys/eurydice.pub
environment:
<<: [*backend-common-envs, *common-origin-envs, *common-auth-envs]
SECRET_KEY: ${DJANGO_SECRET_KEY:?}
EURYDICE_API: origin
ALLOWED_HOSTS: origin.test,backend-origin
CSRF_TRUSTED_ORIGINS: ${CSRF_TRUSTED_ORIGINS}
DJANGO_MANAGEPY_MIGRATE: "on"
METRICS_SLIDING_WINDOW: ${METRICS_SLIDING_WINDOW}
USER_ASSOCIATION_TOKEN_EXPIRES_AFTER: ${USER_ASSOCIATION_TOKEN_EXPIRES_AFTER}
EURYDICE_TRANSFERABLE_MAX_SIZE: ${EURYDICE_TRANSFERABLE_MAX_SIZE}
ENCRYPTION_ENABLED: ${ENCRYPTION_ENABLED}
healthcheck:
test:
- CMD
- /healthcheck.py
interval: 5s
timeout: 5s
retries: 5
# NOTE: in the dev image the stat period is longer because we expect
# the container to apply migrations on first startup
# (in production this should be done by a different service)
start_period: 5s
command:
- make
- run-origin-api
sender:
<<: *backend
depends_on:
# NOTE: we await for the backend container to be healthy
# because it is the one runnning the migrations in
# the developement environment
backend-origin:
condition: service_healthy
lidis:
condition: service_started
volumes:
- ${PYTHON_LOGS_DIR:?}/sender:/var/log/app
- ${ORIGIN_TRANSFERABLE_STORAGE_DIR:?}:/tmp/eurydice-data/origin
- ${PUBKEY_PATH:-/dev/null}:/home/eurydice/keys/eurydice.pub
extra_hosts:
- "lidis.docker.host:host-gateway"
environment:
<<: [*backend-common-envs, *common-origin-envs]
DB_HOST: db-origin
LIDIS_HOST: lidis.docker.host
LIDIS_PORT: ${LIDIS_PORT}
TRANSFERABLE_HISTORY_DURATION: ${TRANSFERABLE_HISTORY_DURATION}
TRANSFERABLE_HISTORY_SEND_EVERY: ${TRANSFERABLE_HISTORY_SEND_EVERY}
SENDER_RANGE_FILLER_CLASS: ${SENDER_RANGE_FILLER_CLASS}
command:
- make
- run-sender
dbtrimmer-origin:
<<: *backend
depends_on:
# NOTE: we await for the backend container to be healthy
# because it is the one runnning the migrations in
# the developement environment
backend-origin:
condition: service_healthy
volumes:
- ${PYTHON_LOGS_DIR:?}/dbtrimmer-origin:/var/log/app
environment:
<<: [*backend-common-envs, *common-origin-envs]
DBTRIMMER_TRIM_TRANSFERABLES_AFTER: ${DBTRIMMER_TRIM_TRANSFERABLES_AFTER}
DBTRIMMER_RUN_EVERY: ${DBTRIMMER_RUN_EVERY}
DBTRIMMER_POLL_EVERY: ${DBTRIMMER_POLL_EVERY}
command:
- make
- run-origin-dbtrimmer
file-remover-origin:
<<: *backend
depends_on:
# NOTE: we await for the backend container to be healthy
# because it is the one runnning the migrations in
# the developement environment
backend-origin:
condition: service_healthy
volumes:
- ${PYTHON_LOGS_DIR:?}/file-remover-origin:/var/log/app
- ${ORIGIN_TRANSFERABLE_STORAGE_DIR:?}:/tmp/eurydice-data/origin
environment:
<<: [*backend-common-envs, *common-origin-envs]
FILE_REMOVER_EXPIRE_TRANSFERABLES_AFTER: ${ORIGIN_FILE_REMOVER_EXPIRE_TRANSFERABLES_AFTER}
FILE_REMOVER_RUN_EVERY: ${ORIGIN_FILE_REMOVER_RUN_EVERY}
FILE_REMOVER_POLL_EVERY: ${ORIGIN_FILE_REMOVER_POLL_EVERY}
command:
- make
- run-origin-file-remover
################ Destination Services ################
receiver:
<<: *backend
depends_on:
# NOTE: we await for the backend container to be healthy
# because it is the one runnning the migrations in
# the developement environment
backend-destination:
condition: service_healthy
volumes:
- ${PYTHON_LOGS_DIR:?}/receiver:/var/log/app
- ${DESTINATION_TRANSFERABLE_STORAGE_DIR:?}:/tmp/eurydice-data
- ${PRIVKEY_PATH:-/dev/null}:/home/eurydice/keys/eurydice
environment:
<<: [*backend-common-envs, *common-destination-envs]
PACKET_RECEIVER_HOST: "0.0.0.0"
PACKET_RECEIVER_PORT: "7000"
RECEIVER_BUFFER_MAX_ITEMS: "${RECEIVER_BUFFER_MAX_ITEMS}"
ports:
- "127.0.0.1:7000:7000"
command:
- make
- run-receiver
dbtrimmer-destination:
<<: *backend
depends_on:
# NOTE: we await for the backend container to be healthy
# because it is the one runnning the migrations in
# the developement environment
backend-destination:
condition: service_healthy
volumes:
- ${PYTHON_LOGS_DIR:?}/dbtrimmer-destination:/var/log/app
- ${DESTINATION_TRANSFERABLE_STORAGE_DIR:?}:/tmp/eurydice-data
environment:
<<: [*backend-common-envs, *common-destination-envs]
DBTRIMMER_TRIM_TRANSFERABLES_AFTER: ${DBTRIMMER_TRIM_TRANSFERABLES_AFTER}
DBTRIMMER_RUN_EVERY: ${DBTRIMMER_RUN_EVERY}
DBTRIMMER_POLL_EVERY: ${DBTRIMMER_POLL_EVERY}
command:
- make
- run-destination-dbtrimmer
file-remover-destination:
<<: *backend
depends_on:
# NOTE: we await for the backend container to be healthy
# because it is the one runnning the migrations in
# the developement environment
backend-destination:
condition: service_healthy
volumes:
- ${PYTHON_LOGS_DIR:?}/file-remover-destination:/var/log/app
- ${DESTINATION_TRANSFERABLE_STORAGE_DIR:?}:/tmp/eurydice-data
environment:
<<: [*backend-common-envs, *common-destination-envs]
FILE_REMOVER_EXPIRE_TRANSFERABLES_AFTER: ${DESTINATION_FILE_REMOVER_EXPIRE_TRANSFERABLES_AFTER}
FILE_REMOVER_RUN_EVERY: ${DESTINATION_FILE_REMOVER_RUN_EVERY}
FILE_REMOVER_POLL_EVERY: ${DESTINATION_FILE_REMOVER_POLL_EVERY}
command:
- make
- run-destination-file-remover
backend-destination:
<<: *backend
depends_on:
db-destination:
condition: service_healthy
volumes:
- ${PYTHON_LOGS_DIR:?}/backend-destination:/var/log/app
- ${DESTINATION_TRANSFERABLE_STORAGE_DIR:?}:/tmp/eurydice-data
environment:
<<: [*backend-common-envs, *common-destination-envs, *common-auth-envs]
SECRET_KEY: "${DJANGO_SECRET_KEY:?}"
EURYDICE_API: destination
ALLOWED_HOSTS: destination.test,backend-destination
CSRF_TRUSTED_ORIGINS: ${CSRF_TRUSTED_ORIGINS}
DJANGO_MANAGEPY_MIGRATE: "on"
METRICS_SLIDING_WINDOW: ${METRICS_SLIDING_WINDOW}
healthcheck:
test:
- CMD
- /healthcheck.py
interval: 5s
timeout: 5s
retries: 5
# NOTE: in the dev image the stat period is longer because we expect
# the container to apply migrations on first startup
# (in production this should be done by a different service)
start_period: 5s
command:
- make
- run-destination-api
frontend-destination:
<<: *frontend
networks:
- eurydice
environment:
VITE_EURYDICE_GUICHET: destination