-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
191 lines (173 loc) · 4.44 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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
version: "3.8"
x-reverse-proxy-env:
&reverse-proxy-env
NGINX_HOST: "${APP_DOMAIN}"
NGINX_PORT: "80"
NGINX_CLIENT_MAX_BODY_SIZE: "${NGINX_CLIENT_MAX_BODY_SIZE}"
MEDIA_ROOT: "/www/media/"
STATIC_ROOT: "/www/static/"
x-frontend-build-env:
&frontend-build-env
NODE_VERSION: "${FRONTEND_NODE_VERSION}"
USER_NAME: "${DOCKER_USER_NAME}"
USER_UID: "${DOCKER_USER_UID}"
USER_GID: "${DOCKER_USER_GID}"
x-core-env:
&core-env
DEBUG: "False"
SECRET_KEY: "${CORE_SECRET_KEY}"
ALLOWED_HOSTS: "${APP_DOMAIN}"
APP_NAME: "${APP_NAME}"
APP_SITE_NAME: "${APP_SITE_NAME}"
LANGUAGE_CODE: "${APP_LANGUAGE_CODE}"
POSTGRES_HOST: "core-db"
POSTGRES_PORT: "5432"
RABBITMQ_HOST: "brocker"
RABBITMQ_PORT: "5672"
REDIS_HOST: "cache"
REDIS_PORT: "6379"
REDIS_DB: "0"
DJANGO_SUPERUSER_USERNAME: "${CORE_SUPERUSER_USERNAME}"
DJANGO_SUPERUSER_PASSWORD: "${CORE_SUPERUSER_PASSWORD}"
DJANGO_SUPERUSER_EMAIL: "${CORE_SUPERUSER_EMAIL}"
x-postgres-env:
&postgres-env
POSTGRES_DB: "${POSTGRES_DB}"
POSTGRES_USER: "${POSTGRES_USER}"
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD}"
x-rabbitmq-env:
&rabbitmq-env
RABBITMQ_DEFAULT_VHOST: "${RABBITMQ_DEFAULT_VHOST}"
RABBITMQ_DEFAULT_USER: "${RABBITMQ_DEFAULT_USER}"
RABBITMQ_DEFAULT_PASS: "${RABBITMQ_DEFAULT_PASS}"
x-email-env:
&email-env
EMAIL_HOST: "${EMAIL_HOST}"
EMAIL_PORT: "${EMAIL_PORT}"
EMAIL_HOST_USER: "${EMAIL_HOST_USER}"
EMAIL_HOST_PASSWORD: "${EMAIL_HOST_PASSWORD}"
EMAIL_USE_TLS: "${EMAIL_USE_TLS}"
EMAIL_USE_SSL: "${EMAIL_USE_SSL}"
services:
reverse-proxy:
image: nginx:${NGINX_VERSION}-alpine
volumes:
- core-media:/www/media:ro
- core-static:/www/static:ro
- ./services/reverse-proxy/nginx/templates:/etc/nginx/templates:ro
environment:
<<: *reverse-proxy-env
ports:
- "${NGINX_HOST_PORT}:80"
depends_on:
- core
restart: unless-stopped
core:
image: ${APP_NAME}:${APP_VERSION}
volumes:
- core-media:/code/services/core/media
- core-static:/code/services/core/static
environment:
<<: *core-env
<<: *rabbitmq-env
<<: *postgres-env
<<: *email-env
expose:
- "8000"
command:
- "./services/core/utils/wait-for-postgres.sh"
- "./services/core/utils/wait-for-rabbitmq.sh"
- "make"
- "-C"
- "/code/services/core"
- "prod"
depends_on:
- core-db
- brocker
- cache
restart: unless-stopped
core-worker-gateway:
image: ${APP_NAME}:${APP_VERSION}
volumes:
- core-media:/code/services/core/media
environment:
<<: *core-env
<<: *rabbitmq-env
<<: *postgres-env
<<: *email-env
command:
- "./services/core/utils/wait-for-postgres.sh"
- "./services/core/utils/wait-for-rabbitmq.sh"
- "make"
- "-C"
- "/code/services/core"
- "worker-gateway"
depends_on:
- core-db
- brocker
- core
restart: unless-stopped
core-worker-computation:
image: ${APP_NAME}:${APP_VERSION}
volumes:
- core-media:/code/services/core/media
environment:
<<: *core-env
<<: *rabbitmq-env
<<: *postgres-env
<<: *email-env
command:
- "./services/core/utils/wait-for-postgres.sh"
- "./services/core/utils/wait-for-rabbitmq.sh"
- "make"
- "-C"
- "/code/services/core"
- "worker-computation"
depends_on:
- core-db
- brocker
- core
restart: unless-stopped
core-db:
image: postgres:${POSTGRES_VERSION}-alpine
volumes:
- core-db-data:/var/lib/postgresql/data
environment:
<<: *postgres-env
expose:
- "5432"
restart: unless-stopped
brocker:
image: rabbitmq:${RABBITMQ_VERSION}-management-alpine
volumes:
- brocker-data:/var/lib/rabbitmq
environment:
<<: *rabbitmq-env
expose:
- "5672"
ports:
- "${RABBITMQ_MANAGEMENT_HOST_PORT}:15672"
restart: unless-stopped
cache:
image: redis:${REDIS_VERSION}-alpine
volumes:
- cache-data:/data
expose:
- "6379"
restart: unless-stopped
volumes:
core-media:
external: false
name: "${APP_NAME}_prod_core-media"
core-static:
external: false
name: "${APP_NAME}_prod_core-static"
core-db-data:
external: false
name: "${APP_NAME}_prod_core-db-data"
brocker-data:
external: false
name: "${APP_NAME}_prod_brocker-data"
cache-data:
external: false
name: "${APP_NAME}_prod_cache-data"