-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
75 lines (69 loc) · 1.42 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
version: '3.3'
services:
db:
image: postgres
environment:
- POSTGRES_USER_FILE=/run/secrets/pg_username
- POSTGRES_PASSWORD_FILE=/run/secrets/pg_password
secrets:
- pg_username
- pg_password
deploy:
replicas: 1
volumes:
- pgdata:/var/lib/postgresql/data/
nginx:
image: nginx:django
ports:
- 80:80
- 443:443
depends_on:
- web
deploy:
mode: global
placement:
constraints:
- node.role == manager
volumes:
# bind mounting
- ./src:/api
- ./log:/var/log/nginx
- /etc/letsencrypt:/etc/letsencrypt
configs:
- nginx
- my_nginx
web:
image: python:django
# command: uwsgi --emperor uwsgi.ini
command: uwsgi --ini uwsgi.ini
volumes:
# bind mounting
- ./src:/api
ports:
- "8002:8000"
depends_on:
- db
environment:
- POSTGRES_USER_FILE=/run/secrets/pg_username
- POSTGRES_PASSWORD_FILE=/run/secrets/pg_password
deploy:
replicas: 1
restart_policy:
condition: on-failure
secrets:
- pg_username
- pg_password
secrets:
pg_username:
external: True
#file: ./pg_username.txt
pg_password:
external: True
#file: ./pg_password.txt
configs:
nginx:
external: true
my_nginx:
external: true
volumes:
pgdata: