-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
68 lines (63 loc) · 1.61 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
version: "3"
volumes:
db-data: {}
services:
postgres:
image: postgres:12.18
deploy:
replicas: 1
restart_policy:
condition: on-failure
environment:
POSTGRES_USER: base
POSTGRES_PASSWORD: development
ports:
- "5432:5432"
networks:
- myapp-net
volumes:
- db-data:/var/lib/postgresql/data
web:
image: myapp-web
build: ./server/Dockerfile
deploy:
replicas: 1
restart_policy:
condition: on-failure
environment:
DATABASE: postgres
POSTGRES_HOST: postgres
POSTGRES_USER: base
POSTGRES_PASSWORD: development
LOG_LEVEL: INFO
#command: bash -c "tail -f /dev/null"
command: bash -c "python manage.py makemigrations app && python manage.py migrate && python manage.py load_sample_data && python manage.py runserver 0.0.0.0:8000"
ports:
- "8000:8000"
depends_on:
- postgres
networks:
- myapp-net
volumes:
- db-data:/var/lib/postgresql/data
# NGINX For SSL Termination or Load Balancing
# nginx:
# image: nginx:1.16
# deploy:
# replicas: 1
# restart_policy:
# condition: on-failure
# environment:
# - REACT_APP_FRONTEND_URL=http://localhost:8080
# ports:
# - "443:443"
# - "8080:8080"
# networks:
# - myapp-net
#volumes:
#- ${REPO_ROOT}/frontend_react/build:/frontend_react/build
#- ${REPO_ROOT}/deploy/nginx/conf.d/nginx.conf:/etc/nginx/conf.d/nginx.conf
#- ${REPO_ROOT}/deploy/nginx/web.crt:/etc/nginx/web.crt
#- ${REPO_ROOT}/deploy/nginx/web.key:/etc/nginx/web.key
networks:
myapp-net: