-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose-prod.yaml
255 lines (238 loc) · 5.51 KB
/
docker-compose-prod.yaml
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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
version: "3"
services:
notify-api:
build:
context: ./notification_api
restart: on-failure
env_file:
- .env
depends_on:
rabbit:
condition: service_healthy
postgres:
condition: service_started
environment:
API_RABBIT_HOST: ${API_RABBIT_HOST:-rabbit}
API_RABBIT_PORT: ${API_RABBIT_PORT:-5672}
API_POSTGRES_HOST: ${API_POSTGRES_HOST:-postgres}
API_POSTGRES_PORT: ${API_POSTGRES_PORT:-5432}
API_PROJECT_ROOT_URL: /notify
expose:
- 8001
admin_notifications:
build:
context: admin
args:
- COMMAND=admin
container_name: django-admin
volumes:
- static_volume:/opt/admin/static
- media_volume:/opt/admin/media
env_file:
- .env
environment:
PG_ADMIN_NF_DB_HOST: ${PG_ADMIN_NF_DB_HOST:-postgres}
PG_ADMIN_NF_DB_PORT: ${PG_ADMIN_NF_DB_PORT:-5432}
depends_on:
- postgres
expose:
- 8000
redis_notifications:
image: redis:7.0.5-alpine
container_name: redis_notifications
restart: always
expose:
- 6379
regular_notice_service:
container_name: regular_notice_service
build:
context: admin
args:
- COMMAND=celery
volumes:
- regular_notice_service_data:/data
restart: always
env_file:
- .env
environment:
PG_ADMIN_NF_DB_HOST: ${PG_ADMIN_NF_DB_HOST:-postgres}
PG_ADMIN_NF_DB_PORT: ${PG_ADMIN_NF_DB_PORT:-5432}
depends_on:
- postgres
- admin_notifications
- redis_notifications
flower:
container_name: flower
build:
context: admin
args:
- COMMAND=flower
volumes:
- flower_data:/data
restart: always
env_file:
- .env
depends_on:
- regular_notice_service
ports:
- 5555:5555
nginx:
image: nginx:latest
container_name: nginx
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./nginx/conf.d:/etc/nginx/conf.d:ro
- static_volume:/opt/admin/static
- media_volume:/opt/admin/media
depends_on:
- admin_notifications
- notify-api
- auth-api
ports:
- 80:80
notification-notify:
build:
context: "./notification_service"
args:
- COMMAND=notify
env_file:
- .env
depends_on:
rabbit:
condition: service_healthy
mailpit:
condition: service_started
notification-rabbit:
condition: service_completed_successfully
notification-user:
build:
context: "./notification_service"
args:
- COMMAND=user
env_file:
- .env
depends_on:
rabbit:
condition: service_healthy
postgres:
condition: service_started
notification-rabbit:
condition: service_completed_successfully
auth-api:
condition: service_healthy
notification-rabbit:
build:
context: "./notification_service"
args:
- COMMAND=rabbit
env_file:
- .env
depends_on:
rabbit:
condition: service_healthy
rabbit:
build:
context: "./rabbitmq"
healthcheck:
test: rabbitmq-diagnostics -q ping
interval: 30s
timeout: 30s
retries: 3
ports:
- 5672:5672
- 15672:15672
postgres:
image: postgres:alpine3.19
volumes:
- db_volume:/var/lib/postgresql/data
environment:
POSTGRES_USER: postgres
POSTGRES_DB: postgres
POSTGRES_PASSWORD: postgres
expose:
- 5432
auth-api:
build:
context: auth_service/src
args:
- COMMAND=release
restart: always
env_file:
- .env
environment:
- AUTH_JAEGER_HOST=jaeger
- AUTH_JAEGER_PORT=6831
- AUTH_POSTGRES_HOST=postgres
- AUTH_POSTGRES_PORT=5432
- AUTH_REDIS_HOST=redis_notifications
- AUTH_REDIS_PORT=6379
- AUTH_RSA_PRIVATE_PATH=/run/secrets/rsa_priv
- AUTH_RSA_PUBLIC_PATH=/run/secrets/rsa_pub
- AUTH_PROJECT_ROOT_URL=/auth
- AUTH_ACCOUNTS_FILE_PATH=/run/secrets/service_accounts
depends_on:
- postgres
- redis_notifications
healthcheck:
test: curl --fail http://127.0.0.1/health || exit 1
interval: 5s
timeout: 30s
retries: 5
volumes:
- ./auth_service/src:/opt/app
secrets:
- rsa_pub
- rsa_priv
- service_accounts
expose:
- 80
elasticsearch:
image: elasticsearch:7.17.14
healthcheck:
test: "curl -f 127.0.0.1:9200 || exit 1"
interval: 10s
timeout: 30s
environment:
- "discovery.type=single-node"
- "xpack.security.enabled=false"
- "ES_JAVA_OPTS=-Xms200m -Xmx200m"
volumes:
- elastic-data:/usr/share/elasticsearch/data
expose:
- 9200
jaeger:
image: jaegertracing/all-in-one:latest
restart: on-failure
environment:
SPAN_STORAGE_TYPE: elasticsearch
ES_SERVER_URLS: "http://${ELASTIC_SEARCH_HOST}:${ELASTIC_SEARCH_PORT}"
depends_on:
- elasticsearch
- auth-api
ports:
- 6831:6831/udp
- 16686:16686
mailpit:
container_name: mailpit
restart: on-failure
image: axllent/mailpit:latest
environment:
- MP_SMTP_AUTH_ALLOW_INSECURE=true
- MP_SMTP_AUTH_ACCEPT_ANY=true
ports:
- 8025:8025
- 1025:1025
volumes:
db_volume:
static_volume:
media_volume:
regular_notice_service_data:
flower_data:
elastic-data:
secrets:
rsa_pub:
file: ./keys/rsa.pub
rsa_priv:
file: ./keys/rsa.private
service_accounts:
file: ./keys/services.json