-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose-prod.yml
59 lines (55 loc) · 1.38 KB
/
docker-compose-prod.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
services:
nginx:
image: public.ecr.aws/nginx/nginx:1.27
ports:
- "8000:80"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
- static_files:/app/static
depends_on:
- web
healthcheck:
test: ["CMD-SHELL", "curl --fail http://localhost:80/ || exit 1"]
interval: 10s
timeout: 5s
retries: 5
web:
image: ghcr.io/codaqui/tutor-image:latest-arm64-v8
env_file:
- .env
depends_on:
postgres:
condition: service_healthy
volumes:
- static_files:/app/static
- ./private-key.pem:/app/private-key.pem
command: >
sh -c "python manage.py migrate
&& python manage.py collectstatic --noinput
&& cp -r /app/staticfiles/* /app/static/
&& python manage.py runserver 0.0.0.0:8000"
links:
- postgres
healthcheck:
test: ["CMD-SHELL", "curl --fail http://localhost:8000/ || exit 1"]
interval: 10s
timeout: 5s
retries: 5
postgres:
image: postgres:17
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER}"]
interval: 10s
timeout: 5s
retries: 5
ports:
- "5432:5432"
volumes:
postgres_data:
static_files: