-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose-prod.yml
459 lines (459 loc) · 12.3 KB
/
docker-compose-prod.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
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
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
services:
npm_cache:
build:
context: ./
dockerfile: npm_cache/Dockerfile
image: npm_cache
control_center:
build:
context: control_center
dockerfile: Dockerfile
env_file:
- .env.prod
networks:
- internal
depends_on:
- npm_cache
restart: unless-stopped
rss_fetch:
build:
context: workers/rss_fetch
dockerfile: Dockerfile
env_file:
- .env.prod
networks:
- internal
depends_on:
- npm_cache
restart: unless-stopped
rss_links_fetch_01:
build:
context: workers/rss_links_fetch
dockerfile: Dockerfile
env_file:
- .env.prod
networks:
- internal
hostname: rss_links_fetch_01
depends_on:
- npm_cache
restart: unless-stopped
rss_links_fetch_02:
build:
context: workers/rss_links_fetch
dockerfile: Dockerfile
env_file:
- .env.prod
networks:
- internal
hostname: rss_links_fetch_02
depends_on:
- npm_cache
restart: unless-stopped
analysis:
build:
context: workers/analysis
dockerfile: Dockerfile
env_file:
- .env.prod
networks:
- internal
depends_on:
- npm_cache
restart: unless-stopped
link_writer:
build:
context: workers/link_writer
dockerfile: Dockerfile
env_file:
- .env.prod
networks:
- internal
depends_on:
- npm_cache
restart: unless-stopped
err_log_writer:
build:
context: workers/err_log_writer
dockerfile: Dockerfile
env_file:
- .env.prod
networks:
- internal
depends_on:
- npm_cache
restart: unless-stopped
link_fix_detector:
build:
context: workers/link_fix_detector
dockerfile: Dockerfile
env_file:
- .env.prod
networks:
- internal
depends_on:
- npm_cache
restart: unless-stopped
redis-0:
build:
context: infrastructure/redis
dockerfile: Dockerfile
target: base
networks:
- internal
restart: unless-stopped
ports:
- 6379
redis-1:
build:
context: infrastructure/redis
dockerfile: Dockerfile
target: slave
networks:
- internal
restart: unless-stopped
ports:
- 6379
redis-2:
build:
context: infrastructure/redis
dockerfile: Dockerfile
target: slave
networks:
- internal
restart: unless-stopped
ports:
- 6379
redis-sentinel-0:
build: infrastructure/redis-sentinel
networks:
- internal
ports:
- 26379
restart: unless-stopped
redis-sentinel-1:
build: infrastructure/redis-sentinel
networks:
- internal
ports:
- 26379
restart: unless-stopped
redis-sentinel-2:
build: infrastructure/redis-sentinel
networks:
- internal
ports:
- 26379
restart: unless-stopped
redis-sentinel-3:
build: infrastructure/redis-sentinel
networks:
- internal
ports:
- 26379
restart: unless-stopped
redis-sentinel-4:
build: infrastructure/redis-sentinel
networks:
- internal
ports:
- 26379
restart: unless-stopped
pg-0:
image: "docker.io/bitnami/postgresql-repmgr:15"
env_file:
- .env.prod
networks:
- internal
ports:
- 5432
restart: unless-stopped
volumes:
- ./infrastructure/datadir/pgdata_0:/bitnami/postgresql
- ./infrastructure/postgre/init:/docker-entrypoint-initdb.d
environment:
POSTGRESQL_POSTGRES_PASSWORD: ${POSTGRESQL_DB_PASSWORD} # admin
POSTGRESQL_USERNAME: ${POSTGRESQL_DB_USER}
POSTGRESQL_PASSWORD: ${POSTGRESQL_DB_PASSWORD}
POSTGRESQL_DATABASE: ${POSTGRESQL_DB_NAME}
REPMGR_PASSWORD: ${REPMGR_PASSWORD}
REPMGR_PRIMARY_HOST: pg-0
REPMGR_PRIMARY_PORT: 5432
REPMGR_PARTNER_NODES: pg-0,pg-1,pg-2
REPMGR_NODE_NAME: pg-0
REPMGR_NODE_NETWORK_NAME: pg-0
REPMGR_PORT_NUMBER: 5432
pg-1:
image: "docker.io/bitnami/postgresql-repmgr:15"
env_file:
- .env.prod
networks:
- internal
ports:
- 5432
restart: unless-stopped
volumes:
- ./infrastructure/datadir/pgdata_1:/bitnami/postgresql
- ./infrastructure/postgre/init:/docker-entrypoint-initdb.d
environment:
POSTGRESQL_POSTGRES_PASSWORD: ${POSTGRESQL_DB_PASSWORD} # admin
POSTGRESQL_USERNAME: ${POSTGRESQL_DB_USER}
POSTGRESQL_PASSWORD: ${POSTGRESQL_DB_PASSWORD}
POSTGRESQL_DATABASE: ${POSTGRESQL_DB_NAME}
REPMGR_PASSWORD: ${REPMGR_PASSWORD}
REPMGR_PRIMARY_HOST: pg-0
REPMGR_PRIMARY_PORT: 5432
REPMGR_PARTNER_NODES: pg-0,pg-1,pg-2
REPMGR_NODE_NAME: pg-1
REPMGR_NODE_NETWORK_NAME: pg-1
REPMGR_PORT_NUMBER: 5432
pg-2:
image: "docker.io/bitnami/postgresql-repmgr:15"
env_file:
- .env.prod
networks:
- internal
ports:
- 5432
restart: unless-stopped
volumes:
- ./infrastructure/datadir/pgdata_2:/bitnami/postgresql
- ./infrastructure/postgre/init:/docker-entrypoint-initdb.d
environment:
POSTGRESQL_POSTGRES_PASSWORD: ${POSTGRESQL_DB_PASSWORD} # admin
POSTGRESQL_USERNAME: ${POSTGRESQL_DB_USER}
POSTGRESQL_PASSWORD: ${POSTGRESQL_DB_PASSWORD}
POSTGRESQL_DATABASE: ${POSTGRESQL_DB_NAME}
REPMGR_PASSWORD: ${REPMGR_PASSWORD}
REPMGR_PRIMARY_HOST: pg-0
REPMGR_PRIMARY_PORT: 5432
REPMGR_PARTNER_NODES: pg-0,pg-1,pg-2
REPMGR_NODE_NAME: pg-2
REPMGR_NODE_NETWORK_NAME: pg-2
REPMGR_PORT_NUMBER: 5432
db_server:
build:
context: infrastructure/haproxy
dockerfile: Dockerfile
args:
- "--sysctl net.ipv4.ip_unprivileged_port_start=0"
env_file:
- .env.prod
networks:
- internal
ports:
- 127.0.0.1:3000:3000
- 127.0.0.1:5432:5432
environment:
POSTGRESQL_USERNAME: ${POSTGRESQL_DB_USER}
POSTGRESQL_PASSWORD: ${POSTGRESQL_DB_PASSWORD}
restart: unless-stopped
volumes:
- ./infrastructure/haproxy:/usr/local/etc/haproxy
kafka-0:
image: "docker.io/bitnami/kafka:3.5.1-debian-11-r7"
networks:
- internal
ports:
- 127.0.0.1:9092:9092
- 127.0.0.1:9093:9093
mem_limit: "2GB"
restart: unless-stopped
environment:
- KAFKA_CFG_PROCESS_ROLES=controller,broker
- KAFKA_CFG_LISTENERS=PLAINTEXT://:9092,CONTROLLER://:9093
- KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT
- KAFKA_CFG_CONTROLLER_LISTENER_NAMES=CONTROLLER
- KAFKA_CFG_CONTROLLER_QUORUM_VOTERS=0@kafka-0:9093,1@kafka-1:9093,2@kafka-2:9093
- KAFKA_CFG_NODE_ID=0
- KAFKA_KRAFT_CLUSTER_ID=abcdefghijklmnopqrstuv
- ALLOW_PLAINTEXT_LISTENER=yes
volumes:
- ./infrastructure/datadir/kafka_0_data:/bitnami/kafka
kafka-1:
image: "docker.io/bitnami/kafka:3.5.1-debian-11-r7"
networks:
- internal
ports:
- 9092
- 9093
mem_limit: "2GB"
restart: unless-stopped
environment:
- KAFKA_CFG_PROCESS_ROLES=controller,broker
- KAFKA_CFG_LISTENERS=PLAINTEXT://:9092,CONTROLLER://:9093
- KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT
- KAFKA_CFG_CONTROLLER_LISTENER_NAMES=CONTROLLER
- KAFKA_CFG_CONTROLLER_QUORUM_VOTERS=0@kafka-0:9093,1@kafka-1:9093,2@kafka-2:9093
- KAFKA_CFG_NODE_ID=1
- KAFKA_KRAFT_CLUSTER_ID=abcdefghijklmnopqrstuv
- ALLOW_PLAINTEXT_LISTENER=yes
volumes:
- ./infrastructure/datadir/kafka_1_data:/bitnami/kafka
kafka-2:
image: "docker.io/bitnami/kafka:3.5.1-debian-11-r7"
networks:
- internal
ports:
- 9092
- 9093
mem_limit: "2GB"
restart: unless-stopped
environment:
- KAFKA_CFG_PROCESS_ROLES=controller,broker
- KAFKA_CFG_LISTENERS=PLAINTEXT://:9092,CONTROLLER://:9093
- KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT
- KAFKA_CFG_CONTROLLER_LISTENER_NAMES=CONTROLLER
- KAFKA_CFG_CONTROLLER_QUORUM_VOTERS=0@kafka-0:9093,1@kafka-1:9093,2@kafka-2:9093
- KAFKA_KRAFT_CLUSTER_ID=abcdefghijklmnopqrstuv
- KAFKA_CFG_NODE_ID=2
- ALLOW_PLAINTEXT_LISTENER=yes
volumes:
- ./infrastructure/datadir/kafka_2_data:/bitnami/kafka
es01:
image: docker.elastic.co/elasticsearch/elasticsearch:${ES_STACK_VERSION}
env_file:
- .env.prod
volumes:
- ./infrastructure/datadir/elastic/esdata01:/usr/share/elasticsearch/data
ports:
- ${ES_PORT}:9200
networks:
- internal
environment:
- node.name=es01
- cluster.name=${ES_CLUSTER_NAME}
- discovery.seed_hosts=es02,es03
- cluster.initial_master_nodes=es01,es02,es03
# - bootstrap.memory_lock=true
- cluster.routing.allocation.disk.threshold_enabled=false
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
mem_limit: ${ES_MEM_LIMIT}
# ulimits:
# memlock:
# soft: -1
# hard: -1
es02:
image: docker.elastic.co/elasticsearch/elasticsearch:${ES_STACK_VERSION}
env_file:
- .env.prod
volumes:
- ./infrastructure/datadir/elastic/esdata02:/usr/share/elasticsearch/data
networks:
- internal
ports:
- ${ES_PORT2}:9200
environment:
- node.name=es02
- cluster.name=${ES_CLUSTER_NAME}
- discovery.seed_hosts=es01,es03
- cluster.initial_master_nodes=es01,es02,es03
# - bootstrap.memory_lock=true
- cluster.routing.allocation.disk.threshold_enabled=false
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
mem_limit: ${ES_MEM_LIMIT}
# ulimits:
# memlock:
# soft: -1
# hard: -1
es03:
image: docker.elastic.co/elasticsearch/elasticsearch:${ES_STACK_VERSION}
env_file:
- .env.prod
volumes:
- ./infrastructure/datadir/elastic/esdata03:/usr/share/elasticsearch/data
networks:
- internal
ports:
- ${ES_PORT3}:9200
environment:
- node.name=es03
- cluster.name=${ES_CLUSTER_NAME}
- discovery.seed_hosts=es01,es02
- cluster.initial_master_nodes=es01,es02,es03
- bootstrap.memory_lock=true
- cluster.routing.allocation.disk.threshold_enabled=false
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
mem_limit: ${ES_MEM_LIMIT}
# ulimits:
# memlock:
# soft: -1
# hard: -1
trace_logger:
image: "jaegertracing/all-in-one"
env_file:
- .env.prod
networks:
- internal
ports:
- 16686:16686
- 14268:14268
#- 9411:9411
- 5778:5778
- 5775:5775/udp
- 6831:6831/udp
- 6832:6832/udp
environment:
SPAN_STORAGE_TYPE: elasticsearch
COLLECTOR_OTLP_ENABLED: true
ES_SERVER_URLS: http://es01:${ES_PORT},http://es02:${ES_PORT2},http://es03:${ES_PORT3}
#REPORTER_GRPC_HOST_PORT: trace_logger:14250
restart: unless-stopped
# jaeger_collector:
# #image: "jaegertracing/all-in-one"
# image: "jaegertracing/jaeger-collector:1.48"
# networks:
# - internal
# container_name: trace_logger
# hostname: trace_logger
# environment:
# SPAN_STORAGE_TYPE: elasticsearch
# COLLECTOR_OTLP_ENABLED: true
# ES_SERVER_URLS: http://es01:${ES_PORT},http://es02:${ES_PORT2},http://es03:${ES_PORT3}
# ports:
# - 14269:14269
# - 14268:14268
# - 14267:14267
# - 14250:14250
# - 9411:9411
# restart: unless-stopped
# jaeger_agent:
# image: "jaegertracing/jaeger-agent:1.48"
# networks:
# - internal
# environment:
# SPAN_STORAGE_TYPE: elasticsearch
# ES_SERVER_URLS: http://es01:${ES_PORT},http://es02:${ES_PORT2},http://es03:${ES_PORT3}
# REPORTER_GRPC_HOST_PORT: trace_logger:14250
# ports:
# - 5775:5775/udp
# - 6831:6831/udp
# - 6832:6832/udp
# - 5778:5778
# restart: unless-stopped
# jaeger_ui:
# image: "jaegertracing/jaeger-query:1.48"
# networks:
# - internal
# environment:
# SPAN_STORAGE_TYPE: elasticsearch
# ES_SERVER_URLS: http://es01:${ES_PORT},http://es02:${ES_PORT2},http://es03:${ES_PORT3}
# ports:
# - 16685:16685
# - 16686:16686
# - 16687:16687
# restart: unless-stopped
kafka_ui:
image: "provectuslabs/kafka-ui:latest"
networks:
- internal
ports:
- 127.0.0.1:8081:8080
environment:
DYNAMIC_CONFIG_ENABLED: 'true'
restart: unless-stopped
volumes:
- ./infrastructure/kafka-ui/config-prod.yml:/etc/kafkaui/dynamic_config.yaml
networks:
internal:
name: internal