-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
72 lines (67 loc) · 1.57 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
version: '2.1'
networks:
default:
name: dci-project-quotes
driver: bridge
volumes:
static_files:
postgres_data:
services:
nginx:
image: nginx:latest
hostname: nginx
container_name: nginx
ports:
- 8080:8080
volumes:
- ./nginx.conf:/etc/nginx/conf.d/default.conf
- static_files:/static
depends_on:
django:
condition: service_healthy
django:
image: dci-project-quotes:${DEMO_QUOTES_VER:-latest}
hostname: django
container_name: django
build:
context: .
dockerfile: Dockerfile
target: build-image
environment:
- PRODUCTION=${PRODUCTION}
- SECRET_KEY=${SECRET_KEY}
- DB_NAME=${DB_NAME}
- DB_USER=${DB_USER}
- DB_PWD=${DB_PWD}
- DB_HOST=${DB_HOST}
- DB_PORT=${DB_PORT}
volumes:
- static_files:/dci-project-quotes/static
depends_on:
postgres:
condition: service_healthy
ports:
- 8000:8000
healthcheck:
test: wget --no-verbose --tries=1 --spider http://localhost:8000 || exit 1
start_period: 10s
timeout: 45s
interval: 5s
retries: 10
postgres:
image: postgres:latest
hostname: postgres
container_name: postgres
environment:
- POSTGRES_DB=${DB_NAME}
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_PWD}
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- 5432:5432
healthcheck:
test: [ "CMD", "pg_isready", "-q", "-d", "${DB_NAME}", "-U", "${DB_USER}" ]
timeout: 45s
interval: 5s
retries: 10