-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
56 lines (53 loc) · 1.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
services:
postgresql:
image: postgres
env_file:
- .env
expose:
- 5432
volumes:
- postgresql_volume:/var/lib/postgresql/data
healthcheck:
test: "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"
start_period: 5s
interval: 5s
timeout: 10s
retries: 5
restart: on-failure
django:
build: ./django
env_file:
- .env
expose:
- 8000
volumes:
- static_volume:/home/app/staticfiles
- media_volume:/home/app/mediafiles
depends_on:
postgresql:
condition: service_healthy
healthcheck:
test: "curl --fail http://localhost:8000/ || exit 1"
start_period: 5s
interval: 5s
timeout: 10s
retries: 5
restart: on-failure
nginx:
build: ./nginx
env_file:
- .env
ports:
- 80:80
- 443:443
volumes:
- static_volume:/home/app/staticfiles
- media_volume:/home/app/mediafiles
depends_on:
django:
condition: service_healthy
restart: on-failure
volumes:
postgresql_volume:
static_volume:
media_volume: