-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathdocker-compose.yml
61 lines (56 loc) · 1.19 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
version: '3'
networks:
psurveyapi:
services:
database:
image: postgres:13.1-alpine
container_name: psurveyapidb
restart: unless-stopped
tty: true
ports:
- 5489:5432
environment:
- POSTGRES_USER=psurveyapi
- POSTGRES_PASSWORD=psurveyapi
- POSTGRES_DB=psurveyapi
networks:
- psurveyapi
pythonpsurvey:
build:
context: .
dockerfile: python.dockerfile
container_name: psurvey-api
restart: unless-stopped
volumes:
- .:/project
depends_on:
- database
expose:
- 9000
networks:
- psurveyapi
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/"]
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:9000
site:
build:
context: .
dockerfile: nginx.dockerfile
container_name: psurveyapi-nginx
restart: unless-stopped
ports:
- "9000:443"
depends_on:
- pythonpsurvey
- database
networks:
- psurveyapi