-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
45 lines (43 loc) · 1.26 KB
/
docker-compose.prod.yml
File metadata and controls
45 lines (43 loc) · 1.26 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
services:
redis:
image: redis:7-alpine
restart: unless-stopped
mem_limit: ${REDIS_MEM_LIMIT:-192m}
command:
[
"redis-server",
"--maxmemory",
"${REDIS_MAXMEMORY:-128mb}",
"--maxmemory-policy",
"${REDIS_MAXMEMORY_POLICY:-allkeys-lru}",
]
volumes:
- redisdata:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 5
web:
build:
context: .
dockerfile: Dockerfile
target: production
restart: unless-stopped
init: true
mem_limit: ${WEB_MEM_LIMIT:-768m}
command: gunicorn config.wsgi:application --worker-class gthread --workers ${GUNICORN_WORKERS:-2} --threads ${GUNICORN_THREADS:-2} --bind 0.0.0.0:8000 --timeout ${GUNICORN_TIMEOUT:-600} --max-requests ${GUNICORN_MAX_REQUESTS:-1000} --max-requests-jitter ${GUNICORN_MAX_REQUESTS_JITTER:-100}
ports:
- "127.0.0.1:8000:8000"
env_file:
- .env
environment:
DATABASE_URL: ${DATABASE_URL:?Set DATABASE_URL in .env}
REDIS_URL: redis://redis:6379/1
DJANGO_SETTINGS_MODULE: config.settings.production
DJANGO_VITE_DEV_MODE: "False"
depends_on:
redis:
condition: service_healthy
volumes:
redisdata: