-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
130 lines (122 loc) · 2.75 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
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
restart: always
deploy:
replicas: 1
smtp:
build:
context: ./smtp
image: tigen/smtp_for_django:mailer
networks:
- nginx_ext_network
secrets:
- django-ehu
- django-ehp
environment:
GMAIL_USER_FILE: /run/secrets/django-ehu
GMAIL_PASSWORD_FILE: /run/secrets/django-ehp
restart: always
ports:
- "25:25"
deploy:
replicas: 1
redis:
image: redis:5.0.5
networks:
- redis_int_network
restart: always
deploy:
replicas: 1
apache:
build:
context: ./apache
args:
git_user_name: 'docker_user'
git_user_email: '[email protected]'
image: tigen/apache_for_django:mailer
networks:
- nginx_ext_network
- db_int_network
- redis_int_network
volumes:
- ./django:/var/www/html/django_project/django
- static_folder:/var/www/static
- user_migrations:/var/www/html/django_project/django/user/migrations
- core_migrations:/var/www/html/django_project/django/core/migrations
secrets:
- psql-pw
- psql-user
- psql-db
- django-sk
- 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_EHU_FILE: /run/secrets/django-ehu
DJANGO_EHP_FILE: /run/secrets/django-ehp
restart: always
depends_on:
- postgres
- smtp
- redis
deploy:
replicas: 1
nginx:
build: ./nginx
image: tigen/nginx_for_django:mailer
environment:
HOST_IP: $HOST_IP
HOST_NAME: $HOST_NAME
networks:
- nginx_ext_network
ports:
- "80:80"
volumes:
- static_folder:/usr/share/nginx/html/static
depends_on:
- apache
deploy:
replicas: 1
networks:
nginx_ext_network:
db_int_network:
internal: true
redis_int_network:
internal: true
volumes:
psql_db_data:
static_folder:
user_migrations:
core_migrations:
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-ehu:
file : secrets/django-ehu
django-ehp:
file : secrets/django-ehp