-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
docker-compose.yml
84 lines (79 loc) · 2.09 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
x-api-common: &api-common
image: ghcr.io/openfoodfacts/open-prices/api:${TAG:-dev}
restart: $RESTART_POLICY
environment:
- POSTGRES_DB
- POSTGRES_USER
- POSTGRES_PASSWORD
- POSTGRES_HOST
- POSTGRES_PORT
- SECRET_KEY
- DEBUG
- ALLOWED_HOSTS
- OAUTH2_SERVER_URL
- SENTRY_DSN
- LOG_LEVEL
- GOOGLE_CLOUD_VISION_API_KEY
- GOOGLE_GEMINI_API_KEY
networks:
- default
services:
api:
<<: *api-common
volumes:
- images:/opt/open-prices/img
- data-dump:/opt/open-prices/data
- home_cache:/home/off/.cache
depends_on:
- postgres
scheduler:
<<: *api-common
command: ["python", "manage.py", "qcluster"]
volumes:
- images:/opt/open-prices/img
- data-dump:/opt/open-prices/data
- home_cache:/home/off/.cache
depends_on:
- postgres
postgres:
restart: $RESTART_POLICY
image: postgres:16.1-alpine
environment:
- POSTGRES_USER
- POSTGRES_PASSWORD
- POSTGRES_DB
volumes:
- postgres-data:/var/lib/postgresql/data
command: postgres -c shared_buffers=1024MB -c work_mem=64MB
mem_limit: 4g
shm_size: 1g
ports:
- "${POSTGRES_EXPOSE:-127.0.0.1:5432}:5432"
nginx:
restart: $RESTART_POLICY
image: nginx:1.25-alpine
volumes:
# Mount the nginx configuration file
- ./nginx.conf:/etc/nginx/nginx.conf
# Mount the static files (robots.txt and vue.js app)
- ./www:/var/www
# Mount the images
- images:/var/img
# And the dir where the daily data dump is stored
- data-dump:/var/data-dump
ports:
- ${API_PORT}:80
volumes:
postgres-data:
name: ${COMPOSE_PROJECT_NAME:-open_prices}_postgres-data
# Store all user-uploaded images in a volume
images:
name: ${COMPOSE_PROJECT_NAME:-open_prices}_images
# Store the daily data dump in a volume
data-dump:
name: ${COMPOSE_PROJECT_NAME:-open_prices}_data-dump
# store ~/.cache in a volume
home_cache:
name: ${COMPOSE_PROJECT_NAME:-open_prices}_home_cache
static:
name: ${COMPOSE_PROJECT_NAME:-open_prices}_static