-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
609 lines (592 loc) · 20.8 KB
/
docker-compose.yml
File metadata and controls
609 lines (592 loc) · 20.8 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
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
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
services:
test:
shm_size: 6gb
build:
context: ./
dockerfile: Dockerfile
entrypoint: [ "poetry", "run", "pytest", "-vv", "-o", "log_cli=true", "--cov-report", "term:skip-covered", "--cov=quotaclimat", "--cov=postgres", "test/" ]
#entrypoint: ["sleep", "12000"] # use to debug the container if needed
environment:
ENV: docker
# CHANNEL: "fr3-idf"
LOGLEVEL: INFO
PYTHONPATH: /app
POSTGRES_USER: user
POSTGRES_DB: barometre
POSTGRES_PASSWORD: password
POSTGRES_HOST: postgres_db
POSTGRES_PORT: 5432
MODIN_ENGINE: ray
tty: true # colorize terminal
volumes:
- ./quotaclimat/:/app/quotaclimat/
- ./postgres/:/app/postgres/
- ./test/:/app/test/
- ./poetry.lock:/app/poetry.lock
- ./pyproject.toml:/app/pyproject.toml
- ./alembic:/app/alembic
- ./alembic.ini:/app/alembic.ini
depends_on:
nginxtest:
condition: service_healthy
postgres_db:
condition: service_healthy
testconsole:
shm_size: 6gb
ports:
- 8080:8080
build:
context: ./
dockerfile: Dockerfile
entrypoint: [ "sleep", "12000" ] # use to debug the container if needed
environment:
DBT_PROFILES_DIR: /app/my_dbt_project/dbt
DBT_PROJECT_DIR: /app/my_dbt_project
ENV: docker
# CHANNEL: "fr3-idf"
LOGLEVEL: DEBUG
PYTHONPATH: /app
LABELSTUDIO_INGESTION_POSTGRES_USER: user
LABELSTUDIO_INGESTION_POSTGRES_PASSWORD: password
POSTGRES_USER: user
POSTGRES_DB: barometre
POSTGRES_PASSWORD: password
POSTGRES_HOST: postgres_db
POSTGRES_PORT: 5432
MODIN_ENGINE: ray
MEDIATREE_USER: /run/secrets/username_api
MEDIATREE_PASSWORD: /run/secrets/pwd_api
BUCKET: /run/secrets/bucket
BUCKET_NAME: germany
BUCKET_OUTPUT: test-bucket-mediatree
BUCKET_SECRET: /run/secrets/bucket_secret
MODIN_CPUS: 4 # "https://modin.readthedocs.io/en/0.11.0/using_modin.html#reducing-or-limiting-the-resources-modin-can-use"
tty: true # colorize terminal
secrets:
- pwd_api
- username_api
- bucket
- bucket_secret
volumes:
- ./quotaclimat/:/app/quotaclimat/
- ./postgres/:/app/postgres/
- ./test/:/app/test/
- ./poetry.lock:/app/poetry.lock
- ./pyproject.toml:/app/pyproject.toml
- ./alembic:/app/alembic
- ./alembic.ini:/app/alembic.ini
- ./my_dbt_project:/app/my_dbt_project
- ./transform_program.py:/app/transform_program.py
- ./parse_dictionary.py:/app/parse_dictionary.py
- ./i8n:/app/i8n
depends_on:
nginxtest:
condition: service_healthy
postgres_db:
condition: service_healthy
nginxtest:
# to test locally webpages
container_name: nginxtest
image: nginx:latest
healthcheck:
test: [ "CMD", "service", "nginx", "status" ]
interval: 5s
timeout: 5s
retries: 5
ports:
- 8000:80
volumes:
- './mockwebsite:/usr/share/nginx/html'
ingest_to_db:
container_name: ingest_to_db
ports:
- 5000:5000
build:
context: ./
dockerfile: Dockerfile_ingest
#entrypoint: ["sleep", "1200"] # use to debug the container if needed
entrypoint: [ "python", "quotaclimat/data_ingestion/ingest_db/ingest_sitemap_in_db.py" ]
environment:
ENV: docker # change me to prod for real cases
LOGLEVEL: INFO # Change me to info (debug, info, warning, error) to have less log
PYTHONPATH: /app
POSTGRES_USER: user
POSTGRES_DB: barometre
POSTGRES_PASSWORD: password
POSTGRES_HOST: postgres_db
POSTGRES_PORT: 5432
PORT: 5000
HEALTHCHECK_SERVER: "0.0.0.0"
volumes:
- ./quotaclimat/:/app/quotaclimat/
- ./postgres/:/app/postgres/
depends_on:
nginxtest:
condition: service_healthy
postgres_db:
condition: service_healthy
stop_word:
ports:
- 5002:5002
build:
context: ./
dockerfile: Dockerfile
entrypoint: [ "./entrypoints/stop_word.sh" ]
environment:
DBT_PROFILES_DIR: /app/my_dbt_project/dbt
ENV: docker # change me to prod for real cases
LOGLEVEL: INFO # Change me to info (debug, info, warning, error) to have less log
PYTHONPATH: /app
POSTGRES_USER: user
POSTGRES_DB: barometre
POSTGRES_PASSWORD: password
POSTGRES_HOST: postgres_db
POSTGRES_PORT: 5432
PORT: 5002
HEALTHCHECK_SERVER: "0.0.0.0"
# NUMBER_OF_PREVIOUS_DAYS: 30
# MIN_REPETITION: 15
# START_DATE: 1731683697
volumes:
- ./quotaclimat/:/app/quotaclimat/
- ./postgres/:/app/postgres/
- ./test/:/app/test/
- ./my_dbt_project:/app/my_dbt_project
depends_on:
nginxtest:
condition: service_healthy
postgres_db:
condition: service_healthy
postgres_db:
image: postgres:15
ports:
- 5432:5432
volumes:
- './pgdata:/var/lib/postgresql/data' # persist data https://stackoverflow.com/a/41650891/3535853
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U user -d barometre" ]
interval: 5s
timeout: 5s
retries: 10
start_period: 30s
environment:
TZ: Europe/Paris # to match prod settings
POSTGRES_USER: user
POSTGRES_DB: barometre
POSTGRES_PASSWORD: password
logging:
# no logs for postgres container
driver: none
mediatree:
shm_size: 6gb
ports:
- 5050:5050
- 8265:8265
build:
context: ./
dockerfile: Dockerfile
entrypoint: [ "./entrypoints/mediatree_import.sh" ]
environment:
DBT_PROFILES_DIR: /app/my_dbt_project/dbt
DBT_PROJECT_DIR: /app/my_dbt_project
ENV: prod # change me to prod for real cases
LOGLEVEL: INFO # Change me to info (debug, info, warning, error) to have less log
PYTHONPATH: /app
LABELSTUDIO_INGESTION_POSTGRES_USER: user
LABELSTUDIO_INGESTION_POSTGRES_PASSWORD: password
POSTGRES_USER: user
POSTGRES_DB: barometre
POSTGRES_PASSWORD: password
POSTGRES_HOST: postgres_db
POSTGRES_PORT: 5432
PORT_HS: 5050 # healthcheck
HEALTHCHECK_SERVER: "0.0.0.0"
COUNTRY: bel-fla
# SENTRY_DSN: prod_only
# UPDATE: "true" # to batch update PG
# BIODIVERSITY_ONLY: "true"
#UPDATE_PROGRAM_ONLY: "true" # to batch update PG but only channel with program
# START_DATE_UPDATE: "2024-02-01" # to batch update PG from a date
# NUMBER_OF_DAYS: 7
STOP_WORD_KEYWORD_ONLY: "true" # speed up execution when we only want to update stop words
#END_DATE: "2024-02-29" # optional - otherwise end of the month
BATCH_SIZE: 100 # number of records to update in one batch
START_DATE: 1773655596 # to test batch import
NUMBER_OF_PREVIOUS_DAYS: 3 # to query mediatree api only - not used for update
# CHANNEL : fr3-idf # to reimport only one channel
MODIN_ENGINE: ray
MODIN_CPUS: 8 # "https://modin.readthedocs.io/en/0.11.0/using_modin.html#reducing-or-limiting-the-resources-modin-can-use"
#MODIN_MEMORY: 1000000000 # 1Gb
RAY_memory_usage_threshold: 1
BUCKET: /run/secrets/bucket
BUCKET_NAME: test-bucket-mediatree
BUCKET_SECRET: /run/secrets/bucket_secret
#mem_limit: "4G"
volumes:
- ./quotaclimat/:/app/quotaclimat/
- ./postgres/:/app/postgres/
- ./test/:/app/test/
- ./my_dbt_project:/app/my_dbt_project
secrets:
- bucket
- bucket_secret
depends_on:
nginxtest:
condition: service_healthy
postgres_db:
condition: service_healthy
api_to_s3:
shm_size: 6gb
ports:
- 5666:5666
- 8265:8265
build:
context: ./
dockerfile: Dockerfile
entrypoint: [ "python", "quotaclimat/data_processing/mediatree/s3/api_to_s3.py" ]
environment:
ENV: docker # change me to prod for real cases
LOGLEVEL: INFO # Change me to info (debug, info, warning, error) to have less log
PYTHONPATH: /app
PORT_HS: 5666 # healthcheck
HEALTHCHECK_SERVER: "0.0.0.0"
COUNTRY: bel-fla # see country.py to get all country 3-letter codes
# SENTRY_DSN: prod_only
#END_DATE: "2024-02-29" # optional - otherwise end of the month
START_DATE: 1773655596 # to test batch import
# CHANNEL : daserste # to reimport only one channel
NUMBER_OF_PREVIOUS_DAYS: 3
MEDIATREE_USER: /run/secrets/username_api
MEDIATREE_PASSWORD: /run/secrets/pwd_api
BUCKET: /run/secrets/bucket
BUCKET_SECRET: /run/secrets/bucket_secret
BUCKET_NAME: test-bucket-mediatree
MEDIATREE_AUTH_URL: https://keywords.mediatree.fr/api/auth/token/
KEYWORDS_URL: https://keywords.mediatree.fr/api/v2/subtitle/ # https://keywords.mediatree.fr/docs/#api-Subtitle-SubtitleList
MODIN_ENGINE: ray
MODIN_CPUS: 6 # "https://modin.readthedocs.io/en/0.11.0/using_modin.html#reducing-or-limiting-the-resources-modin-can-use"
MODIN_MEMORY: 12000000000 # 1Gb
RAY_memory_usage_threshold: 0.95
volumes:
- ./quotaclimat/:/app/quotaclimat/
- ./postgres/:/app/postgres/
- ./test/:/app/test/
- ./s3:/app/s3/
secrets:
- pwd_api
- username_api
- bucket
- bucket_secret
depends_on:
nginxtest:
condition: service_healthy
postgres_db:
condition: service_healthy
metabase:
container_name: metabase_barometre
image: metabase/metabase:latest
volumes:
- './mb-data:/metabase-data' # Volumes where Metabase data will be persisted
ports:
- 3000:3000
environment:
MB_DB_TYPE: postgres
MB_DB_DBNAME: barometre
MB_DB_PORT: 5432
MB_DB_USER: user
MB_DB_PASS: password
MB_DB_HOST: postgres_db
MB_DB_FILE: "/metabase-data/metabase.db" # https://www.metabase.com/docs/latest/operations-guide/running-metabase-on-docker.html#mounting-a-mapped-file-storage-volume
JAVA_TIMEZONE: Europe/Paris
depends_on:
postgres_db:
condition: service_healthy
srt:
shm_size: 6gb
build:
context: ./
dockerfile: Dockerfile
entrypoint: [ "python", "i8n/srt-to-mediatree-format-parquet.py" ]
environment:
ENV: docker # change me to prod for real cases
LOGLEVEL: INFO # Change me to info (debug, info, warning, error) to have less log
PYTHONPATH: /app
PORT_HS: 5050 # healthcheck
HEALTHCHECK_SERVER: "0.0.0.0"
# SENTRY_DSN: prod_only
DATE: "2025-05-01"
NUMBER_OF_PREVIOUS_DAYS: 2 # to query mediatree api only - not used for update
MODIN_ENGINE: ray
BUCKET: /run/secrets/bucket
BUCKET_NAME: germany
BUCKET_OUTPUT: test-bucket-mediatree
BUCKET_SECRET: /run/secrets/bucket_secret
PATH_PARQUET: raw_data.parquet
TIMEZONE: Europe/Berlin
S3_ROOT_FOLDER: country=germany
MODIN_CPUS: 4
volumes:
- ./quotaclimat/:/app/quotaclimat/
- ./postgres/:/app/postgres/
- ./test/:/app/test/
- ./i8n:/app/i8n
secrets:
- bucket
- bucket_secret
factiva_to_s3:
container_name: factiva_to_s3
build:
context: ./
dockerfile: Dockerfile_factiva_to_s3
environment:
LOGLEVEL: INFO
PYTHONPATH: /app
PORT_HS: 5050
HEALTHCHECK_SERVER: "0.0.0.0"
FACTIVA_S3_BUCKET: "factiva"
FACTIVA_S3_PREFIX: "country_france"
FACTIVA_BATCH_SIZE: "100"
FACTIVA_MAX_EMPTY_PULLS: "3"
FACTIVA_EMPTY_PULL_WAIT: "5"
FACTIVA_PULL_TIMEOUT: "30"
FACTIVA_LOCAL_TMP: "/tmp/factiva"
FACTIVA_MOCK_MODE: "false"
FACTIVA_MOCK_SOURCE_DIR: "/app/test/factiva_mock"
FACTIVA_MOCK_FILE_PATTERN: "*.json"
FACTIVA_USERKEY_FILE: /run/secrets/factiva_userkey
FACTIVA_SUBSCRIPTION_ID_FILE: /run/secrets/stream_subscription_main
BUCKET: /run/secrets/bucket
BUCKET_SECRET: /run/secrets/bucket_secret
volumes:
- ./quotaclimat/:/app/quotaclimat/
- ./postgres/:/app/postgres/
- ./test/:/app/test/
secrets:
- bucket
- bucket_secret
- factiva_userkey
- stream_subscription_main
depends_on:
postgres_db:
condition: service_healthy
factiva_stats_to_s3:
container_name: factiva_stats_to_s3
ports:
- 5003:5000
build:
context: ./
dockerfile: Dockerfile_factiva_stats_to_s3
#entrypoint: ["sleep", "1200"] # use to debug the container if needed
environment:
LOGLEVEL: INFO
PYTHONPATH: /app
PORT: 5000
HEALTHCHECK_SERVER: "0.0.0.0"
# Factiva API credentials (from secrets)
FACTIVA_USERKEY: /run/secrets/factiva_userkey
# Factiva stats configuration
FACTIVA_MINIMAL_WORD_COUNT: "0"
FACTIVA_LANGUAGE_CODE: "fr"
FACTIVA_LOCAL_TMP: "/tmp/factiva_stats"
FACTIVA_DAYS_BEFORE_TODAY: "7"
FACTIVA_STATS_ANALYSIS_DURATION: "7"
# New configuration variables
EXTRACT_STATS: "true"
SELECT_DATE: "false"
# START_DATE: "2025-11-16" # Only used when SELECT_DATE=true
# END_DATE: "2025-11-16" # Only used when SELECT_DATE=true
# S3 configuration (Scaleway, from secrets)
FACTIVA_S3_BUCKET: "factiva"
FACTIVA_S3_PREFIX: "country_france"
BUCKET: /run/secrets/bucket
BUCKET_SECRET: /run/secrets/bucket_secret
volumes:
- ./quotaclimat/:/app/quotaclimat/
- ./postgres/:/app/postgres/
- ./test/:/app/test/
- ./tmp/factiva_stats:/tmp/factiva_stats
secrets:
- bucket
- bucket_secret
- factiva_userkey
depends_on:
postgres_db:
condition: service_healthy
s3_factiva_to_postgre:
container_name: s3_factiva_to_postgre
ports:
- 5004:5000
build:
context: ./
dockerfile: Dockerfile_s3_factiva_to_postgre
#entrypoint: ["sleep", "1200"] # use to debug the container if needed
environment:
ENV: docker
LOGLEVEL: INFO
PYTHONPATH: /app
PORT: 5000
HEALTHCHECK_SERVER: "0.0.0.0"
# PostgreSQL configuration
POSTGRES_USER: user
POSTGRES_DB: print_media_db
POSTGRES_PASSWORD: password
POSTGRES_HOST: print_media_db
POSTGRES_PORT: 5433
# S3 configuration (Scaleway, from secrets)
S3_BUCKET_NAME: "factiva"
S3_REGION: "fr-par"
S3_ACCESS_KEY: /run/secrets/bucket
S3_SECRET_KEY: /run/secrets/bucket_secret
S3_ENDPOINT_URL: "https://s3.fr-par.scw.cloud"
S3_BASE_PREFIX: "country_france"
# Processing configuration (normal import mode)
PROCESS_ARTICLES: "true"
PROCESS_STATS: "true"
LOOKBACK_DAYS: "30"
LOCAL_TMP_DIR: "/tmp/s3_factiva_to_postgre"
# Dictionary update configuration
UPDATE_DICTIONARY: "false" # Update Dictionary, Keyword_Macro_Category, and Source_Classification tables (default: true)
# Duplicate detection configuration
DETECT_DUPLICATES: "true" # Detect and mark duplicate articles before DBT processing (default: true)
# Article filtering configuration
MINIMAL_WORD_COUNT: "200" # Minimum word count for articles to be included in crisis counts (default: 0)
# DBT configuration
RUN_DBT: "true" # Run DBT models after processing (default: true)
DBT_PROFILES_DIR: /app/my_dbt_project_print_media/dbt
DBT_PROJECT_DIR: /app/my_dbt_project_print_media
# HRFP multipliers for crisis scoring (default: 0 = no HRFP consideration)
MULTIPLIER_HRFP_CLIMAT: "0" # Multiplier for climate HRFP keywords
MULTIPLIER_HRFP_BIODIV: "0" # Multiplier for biodiversity HRFP keywords
MULTIPLIER_HRFP_RESSOURCE: "0" # Multiplier for resource HRFP keywords
# Article length-based thresholds configuration
CONSIDER_ARTICLE_LENGTH: "true" # Enable article length-based thresholds (default: false)
WORD_COUNT_THRESHOLD: "600" # Article length segments (e.g., "350-600" or "350-600-900")
# Thresholds for crisis labeling
# If CONSIDER_ARTICLE_LENGTH=false: single threshold (format: "biodiv,climat,ressource")
# If CONSIDER_ARTICLE_LENGTH=true: multiple thresholds per length segment (format: "b1,c1,r1 - b2,c2,r2 - b3,c3,r3")
THRESHOLD_BIOD_CLIM_RESS: "2,2,2 - 3,2,2" # Thresholds for biodiversity, climate, resource
# Thresholds for causal links labeling
# If CONSIDER_ARTICLE_LENGTH=false: single threshold per causal link
# If CONSIDER_ARTICLE_LENGTH=true: multiple thresholds separated by " - "
THRESHOLD_BIOD_CONST_CAUSE_CONSE_SOLUT: "2,1,1,1 - 2,1,1,1" # Biodiversity causal links: constat, cause, consequence, solution
THRESHOLD_CLIM_CONST_CAUSE_CONSE_SOLUT: "2,1,1,1 - 2,1,1,1" # Climate causal links: constat, cause, consequence, solution
THRESHOLD_RESS_CONST_SOLUT: "1,1 - 1,1" # Resource causal links: constat, solution
# UPDATE mode configuration (keyword re-detection)
UPDATE: "true" # Enable UPDATE mode (re-detect keywords on existing data)
START_DATE_UPDATE: "2025-11-25" # Filter on publication_datetime >= this date
END_DATE: "2025-11-29" # Filter on publication_datetime <= this date
# BATCH_SIZE: "1000" # Number of articles per batch
# # SOURCE_CODE_UPDATE: "LEMOND, FIGARO" # Comma-separated list of source_code to filter
# # BIODIVERSITY_ONLY: "true" # Only update articles with number_of_biodiversite_no_hrfp >= 1
# # RESSOURCE_ONLY: "true" # Only update articles with number_of_ressources_no_hrfp >= 1
# # CLIMATE_ONLY: "true" # Only update articles with number_of_climat_no_hrfp >= 1
THRESHOLD_AGRI_MOBI_BATI_ECON_ENERG_INDU_EAU_ECOS: "2,2,2,1,1,2,1,2" # Thresholds for each sector (agriculture_alimentation,mobilite,batiments_amenagement,economie_circulaire,energie,industrie,eau,ecosysteme)
volumes:
- ./quotaclimat/:/app/quotaclimat/
- ./postgres/:/app/postgres/
- ./alembic_factiva:/app/alembic_factiva
- ./alembic_factiva.ini:/app/alembic_factiva.ini
- ./my_dbt_project_print_media:/app/my_dbt_project_print_media
- ./tmp/s3_factiva_to_postgre:/tmp/s3_factiva_to_postgre
secrets:
- bucket
- bucket_secret
depends_on:
print_media_db:
condition: service_healthy
print_media_db:
image: postgres:15
ports:
- 5433:5433
volumes:
- './pgdata-factiva:/var/lib/postgresql/data' # persist data https://stackoverflow.com/a/41650891/3535853
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U user -d print_media_db" ]
interval: 5s
timeout: 5s
retries: 10
start_period: 30s
environment:
TZ: Europe/Paris # to match prod settings
POSTGRES_USER: user
POSTGRES_DB: print_media_db
POSTGRES_PASSWORD: password
PGPORT: 5433
# logging: # no logs for postgres container
# driver: none
analyse_instagram_data:
entrypoint: [ "poetry", "run", "python", "analyse/instagram/analyse.py" ]
build:
context: ./
dockerfile: duckdb.Dockerfile
volumes:
- "./:/workspace"
working_dir: "/workspace"
depends_on:
- postgres_db
ftp_server:
container_name: my-ftp-server
environment:
- PUBLIC_IP=192.168.0.1
- FTP_PASS=password123
- FTP_USER=quotaclimat
image: garethflowers/ftp-server
ports:
- "20-21:20-21/tcp"
- "40000-40009:40000-40009/tcp" # For passive mode
volumes:
- ./quotaclimat/data_ingestion/lemonde_ftp/ftp_data:/home/quotaclimat
lemonde_ftp_to_s3:
container_name: lemonde_ftp_to_s3
ports:
- 5003:5000
build:
context: ./
dockerfile: Dockerfile_factiva_to_s3
entrypoint: [ "python", "quotaclimat/data_ingestion/lemonde_ftp/ftp_to_s3.py" ]
environment:
FTP_HOST: ftp_server
# Change to secret to use in prod
# FTP_HOST: /run/secrets/lemonde_ftp_host
FTP_USER: quotaclimat
FTP_PASS: password123
# Change to secret to use in prod
# FTP_PASS: /run/secrets/lemonde_ftp_pass
FTP_PORT: 21
S3_BUCKET_NAME: "test-bucket-mediatree"
S3_REGION: "fr-par"
S3_ACCESS_KEY: /run/secrets/bucket
S3_SECRET_KEY: /run/secrets/bucket_secret
START_DATE: "20260221"
NUMBER_DAYS_PRIOR: 7
OVERRIDE: "false"
# volumes:
# - ./quotaclimat/data_ingestion/lemonde_ftp/data:/outputs
secrets:
- lemonde_ftp_host
- lemonde_ftp_pass
- bucket
- bucket_secret
depends_on:
ftp_server:
condition: service_healthy
secrets:
# https://docs.docker.com/compose/use-secrets/
pwd_api:
file: secrets/pwd_api.txt
username_api:
file: secrets/username_api.txt
bucket:
file: secrets/scw_bucket.txt
bucket_secret:
file: secrets/scw_bucket_secret.txt
stream_factiva:
file: secrets/stream_factiva.txt
stream_subscription_main:
file: secrets/stream_subscription_main.txt
factiva_userkey:
file: secrets/factiva_userkey.txt
lemonde_ftp_host:
file: secrets/lemonde_ftp_host.txt
lemonde_ftp_pass:
file: secrets/lemonde_ftp_pass.txt