-
Notifications
You must be signed in to change notification settings - Fork 4
/
docker-compose.yml
62 lines (58 loc) · 1.23 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
version: '3'
networks:
psurvey:
services:
database:
image: postgres:13.1-alpine
container_name: psurveydb
restart: unless-stopped
tty: true
ports:
- 5433:5432
environment:
- POSTGRES_USER=psurvey
- POSTGRES_PASSWORD=psurvey
- POSTGRES_DB=psurvey
volumes:
- ../scripts/psurvey.sql:/docker-entrypoint-initdb.d/psurvey.sql
networks:
- psurvey
pythonapp:
build:
context: .
dockerfile: python.dockerfile
container_name: psurvey-app
restart: unless-stopped
volumes:
- .:/project
depends_on:
- database
expose:
- 9100
networks:
- psurvey
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9100/"]
command:
- /bin/bash
- -c
- |
sleep 10
python manage.py makemigrations --merge
sleep 10
python manage.py migrate --noinput
sleep 10
python manage.py runserver 0.0.0.0:9100
site:
build:
context: .
dockerfile: nginx.dockerfile
container_name: psurveyapp-nginx
restart: unless-stopped
ports:
- "9100:443"
depends_on:
- pythonapp
- database
networks:
- psurvey