-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
85 lines (79 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
version: "3.9"
services:
# database
db:
image: postgres:14
container_name: postgres
volumes:
- type: volume
source: db_data
target: /var/lib/postgresql/data
env_file:
- .env
restart: always
# web app
gunicorn:
build: .
container_name: gunicorn-django
volumes:
# source files
- type: bind
source: .
target: /smartdoor_host
# gunicoen unix socket
- type: volume
source: gunicorn
target: /var/run/gunicorn
env_file:
- .env
depends_on:
- db
restart: always
command: >
sh -c "
python manage.py migrate
gunicorn smartdoor_prj.wsgi --bind=unix:/var/run/gunicorn/gunicorn.sock
"
# create SSL Certificates
cert:
image: paulczar/omgwtfssl
container_name: ssl
env_file:
- .env
volumes:
- type: bind
source: ssl_certs
target: /certs
# web server
nginx:
image: nginx
container_name: nginx
ports:
- target: 80
published: 80
- target: 443
published: 443
volumes:
# .conf file
- type: bind
source: ./nginx.conf
target: /etc/nginx/conf.d/default.conf
# gunicorn unix socket
- type: volume
source: gunicorn
target: /var/run/gunicorn
# static dir
- type: bind
source: ./smartdoor_prj/static
target: /static
# ssl cert
- type: bind
source: ssl_certs
target: /etc/ssl_cert
depends_on:
- gunicorn
- cert
restart: always
volumes:
db_data:
gunicorn: