-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
54 lines (49 loc) · 1.17 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
version: "3.7"
x-api-common: &api-common
image: ghcr.io/openfoodfacts/nutripatrol/api:${TAG:-dev}
restart: ${RESTART_POLICY}
environment:
- SENTRY_DNS
- LOG_LEVEL
- POSTGRES_USER
- POSTGRES_PASSWORD
- POSTGRES_DB
- POSTGRES_HOST
- CORS_ALLOW_ORIGINS
- OFF_TLD
networks:
- default
services:
api:
<<: *api-common
volumes:
- ./static:/opt/nutripatrol/static
depends_on:
- postgres
postgres:
restart: $RESTART_POLICY
image: postgres:16.0-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
- ./static:/var/static
ports:
- ${API_EXPOSE:-127.0.0.1:8000}:80
volumes:
postgres-data:
name: ${COMPOSE_PROJECT_NAME:-nutripatrol}-postgres-data