-
Notifications
You must be signed in to change notification settings - Fork 4
/
docker-compose.yaml
93 lines (87 loc) · 2.68 KB
/
docker-compose.yaml
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
version: '3.3'
services:
db:
image: postgres:13
restart: always
env_file:
- env/django_db.env
volumes:
- ./deploy/db_creation.sh:/docker-entrypoint-initdb.d/init.sh
- ./data/postgres:/var/lib/postgresql/data
networks:
- net-iris
web:
build: .
# DEVELOPMENT:
command: >
bash -c "
yarn add global vue-cli;
yarn build --no-clean &&
pipenv run ./manage.py collectstatic --no-input &&
pipenv run python manage.py migrate &&
yarn serve &
pipenv run python manage.py runserver 0.0.0.0:8000"
# PRODUCTION:
# command: >
# bash -c "
# yarn build --no-clean &&
# pipenv run ./manage.py collectstatic --no-input &&
# pipenv run ./manage.py migrate &&
# pipenv run gunicorn --log-level debug --access-logfile - \
# --workers 3 --bind 0.0.0.0:8000 backend.wsgi:application"
restart: always
env_file:
- env/django_db.env
- env/django_app.env
volumes:
# source
- type: bind
source: ./
target: /app
read_only: false
# dataset - web app access
- type: bind
source: ./data/dataset
target: /app/backend/dataset
read_only: false
# dataset - guest access
- type: bind
source: ./data/dataset
target: /app/dist/static/data
read_only: false
ports:
- "8000:8000"
- "9000:9000"
depends_on:
- db
networks:
- net-nginx-proxy
- net-iris
# certbot:
# image: certbot/certbot
# entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
# networks:
# - net-nginx-proxy
# volumes:
# - ./deploy/certbot/conf:/etc/letsencrypt
# - ./deploy/certbot/www:/var/www/certbot
nginx:
image: nginx:1.19.0-alpine
restart: always
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
ports:
- 80:80
- 443:443
depends_on:
- web
networks:
- net-nginx-proxy
volumes:
- ./deploy/nginx:/etc/nginx/conf.d
# - ./deploy/certbot/conf:/etc/letsencrypt
# - ./deploy/certbot/www:/var/www/certbot
networks:
net-nginx-proxy:
external: true
net-iris:
external: false