-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
50 lines (46 loc) · 1.12 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
version: '3.8'
services:
django_app:
build:
context: ./django_app
dockerfile: Dockerfile
expose:
- 8000
env_file:
- ./.env
environment:
- DATABASE_URL=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}
volumes:
- ./django_app:/home/app/django_app/
- staticfiles_vol:/home/app/django_app/staticfiles
- media_vol:/home/app/django_app/media
depends_on:
postgres_db:
condition: service_healthy
nginx:
build:
context: ./nginx
dockerfile: Dockerfile
volumes:
- staticfiles_vol:/home/app/friendly/staticfiles
- media_vol:/home/app/friendly/media
ports:
- ${NGINX_HOST_PORT}:80
depends_on:
- django_app
postgres_db:
image: postgres:15
volumes:
- postgres_data:/var/lib/postgresql/data/
env_file:
- ./.env
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
start_period: 5s
interval: 10s
timeout: 5s
retries: 5
volumes:
postgres_data:
staticfiles_vol:
media_vol: