-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
69 lines (61 loc) · 1.6 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
x-base-volumes:
&base-volumes
- home_cache:/home/off/.cache
- tmp:/tmp
- datasets:/app/datasets
x-service-base:
&service-base
restart: $RESTART_POLICY
# this image is built with target=runtime, so it won't have the dev dependencies
image: ghcr.io/openfoodfacts/openfoodfacts-exports:${TAG}
volumes: *base-volumes
x-service-base-env:
&service-base-env
ENVIRONMENT:
SENTRY_DSN:
REDIS_HOST:
ENABLE_HF_PUSH:
ENABLE_S3_PUSH:
HF_TOKEN: # Hugging Face token to push to the dataset hub
AWS_ACCESS_KEY:
AWS_SECRET_KEY:
services:
scheduler:
<<: *service-base
environment: *service-base-env
command: python -m openfoodfacts_exports run-scheduler
mem_limit: 4g
depends_on:
- redis
workers:
<<: *service-base
environment: *service-base-env
command: python3 -m openfoodfacts_exports run-worker off-exports-high off-exports-low
mem_limit: 8g
depends_on:
- redis
deploy:
replicas: ${NUM_RQ_WORKERS:-4}
redis:
restart: $RESTART_POLICY
image: redis:7.0.5-alpine
volumes:
- redis-data:/data
environment:
REDIS_ARGS: --save 60 1000 --appendonly yes
mem_limit: 4g
ports:
- "6379"
volumes:
# Volume mount on /tmp to prevent large docker layer overlay
tmp:
name: ${COMPOSE_PROJECT_NAME:-off_exports}_tmp
# Volume mount on ~/.cache to prevent large docker layer overlay
home_cache:
name: ${COMPOSE_PROJECT_NAME:-off_exports}_cache
redis-data:
name: ${COMPOSE_PROJECT_NAME:-off_exports}_redis-data
datasets:
name: ${COMPOSE_PROJECT_NAME:-off_exports}_datasets
networks:
default: