-
Notifications
You must be signed in to change notification settings - Fork 0
/
swarm.yml
103 lines (97 loc) · 2.44 KB
/
swarm.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
version: '3.1'
services:
postgres:
image: postgres:11.4-alpine
networks:
- db_int_network
volumes:
- psql_db_data:/var/lib/postgresql/data
secrets:
- psql-pw
- psql-user
- psql-db
environment:
POSTGRES_PASSWORD_FILE: /run/secrets/psql-pw
POSTGRES_USER_FILE: /run/secrets/psql-user
POSTGRES_DB_FILE: /run/secrets/psql-db
deploy:
replicas: 1
apache:
image: tigen/apache_for_django:1
networks:
- db_int_network
- nginx_ext_network
expose:
- 80
volumes:
- core_migrations:/var/www/html/django_project/do_you_know/django/core/migrations
- img_migrations:/var/www/html/django_project/do_you_know/django/img/migrations
- user_migrations:/var/www/html/django_project/do_you_know/django/user/migrations
- contacts_migrations:/var/www/html/django_project/do_you_know/django/contacts/migrations
- static_folder:/var/www/html/django_project/do_you_know/django/static
- media_folder:/var/www/media
secrets:
- psql-pw
- psql-user
- psql-db
- django-sk
- django-eh
- django-ehu
- django-ehp
environment:
HOST_IP: $HOST_IP
HOST_NAME: $HOST_NAME
POSTGRES_PASSWORD_FILE: /run/secrets/psql-pw
POSTGRES_USER_FILE: /run/secrets/psql-user
POSTGRES_DB_FILE: /run/secrets/psql-db
DJANGO_SK_FILE: /run/secrets/django-sk
DJANGO_EH_FILE: /run/secrets/django-eh
DJANGO_EHU_FILE: /run/secrets/django-ehu
DJANGO_EHP_FILE: /run/secrets/django-ehp
depends_on:
- postgres
deploy:
replicas: 1
nginx:
image: tigen/nginx_for_django:1
networks:
- nginx_ext_network
ports:
- "80:80"
environment:
HOST_IP: $HOST_IP
HOST_NAME: $HOST_NAME
volumes:
- static_folder:/usr/share/nginx/html/static
- media_folder:/usr/share/nginx/html/media
depends_on:
- apache
deploy:
replicas: 1
networks:
db_int_network:
internal: true
nginx_ext_network:
volumes:
psql_db_data:
core_migrations:
img_migrations:
user_migrations:
contacts_migrations:
static_folder:
media_folder:
secrets:
psql-pw:
file : secrets/psql-pw
psql-user:
file : secrets/psql-user
psql-db:
file : secrets/psql-db
django-sk:
file : secrets/django-sk
django-eh:
file : secrets/django-eh
django-ehu:
file : secrets/django-ehu
django-ehp:
file : secrets/django-ehp