-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
340 lines (322 loc) · 8.3 KB
/
docker-compose.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
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
version: "3.9"
services:
com-request-api:
build:
context: .
dockerfile: Dockerfile.api
restart: unless-stopped
logging:
driver: 'gelf'
options:
gelf-address: 'udp://localhost:12201'
tag: com-request-api
networks:
- ompnw
depends_on:
- postgres
links:
- postgres
ports:
- 8080:8080 # REST
- 8082:8082 # gRPC
- 9100:9100 # Metrics prometheus
- 8000:8000 # Status prometheus
- 40000:40000 # Debug port
healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost:8000/live']
interval: 1m
timeout: 10s
retries: 3
start_period: 20s
volumes:
- ./migrations/migrations:/root/migrations
- ./config.yml:/root/config.yml
xlator:
build:
context: .
dockerfile: Dockerfile.xlator
restart: unless-stopped
logging:
driver: 'gelf'
options:
gelf-address: 'udp://localhost:12201'
tag: xlator
networks:
- ompnw
depends_on:
- postgres
- kafka-1
- kafka-2
- kafka-3
links:
- postgres
- kafka-1
- kafka-2
- kafka-3
volumes:
- ./config.yml:/root/config.yml
postgres:
image: postgres:latest
healthcheck:
test: [ "CMD", "pg_isready", "-q", "-d", "postgres", "-U", "postgres" ]
timeout: 45s
interval: 10s
retries: 10
restart: always
logging:
driver: 'gelf'
options:
gelf-address: 'udp://localhost:12201'
tag: postgres
ports:
- 5432:5432
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: ozonmp
APP_DB_USER: docker
APP_DB_PASS: docker
networks:
- ompnw
volumes:
- ../postgres_data:/var/lib/postgresql/data:rw
- ./scripts/init-database.sh:/docker-entrypoint-initdb.d/init-database.sh
zookeeper:
image: confluentinc/cp-zookeeper
restart: unless-stopped
logging:
driver: 'gelf'
options:
gelf-address: 'udp://localhost:12201'
tag: zookeeper
ports:
- 2181:2181
environment:
zk_id: "1"
ZOOKEEPER_CLIENT_PORT: 32181
ZOOKEEPER_TICK_TIME: 2000
ZOOKEEPER_SYNC_LIMIT: 2
networks:
- ompnw
kafka-1:
image: confluentinc/cp-kafka
restart: unless-stopped
logging:
driver: 'gelf'
options:
gelf-address: 'udp://localhost:12201'
tag: kafka-1
depends_on:
- zookeeper
ports:
- 9094:9094
environment:
KAFKA_ZOOKEEPER_CONNECT: "zookeeper:32181"
KAFKA_LISTENERS: INTERNAL://kafka-1:9092,OUTSIDE://kafka-1:9094
KAFKA_ADVERTISED_LISTENERS: INTERNAL://kafka-1:9092,OUTSIDE://localhost:9094
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL:PLAINTEXT,OUTSIDE:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL
KAFKA_BROKER_ID: 500
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 3
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ../kafka_data/500:/kafka
networks:
- ompnw
# command: sh -c "((sleep 15 && kafka-topics --create --zookeeper zookeeper:32181 --replication-factor 3 --partitions 5 --topic com-request-events)&) && /etc/confluent/docker/run"
kafka-2:
image: confluentinc/cp-kafka
restart: unless-stopped
logging:
driver: 'gelf'
options:
gelf-address: 'udp://localhost:12201'
tag: kafka-2
depends_on:
- zookeeper
ports:
- 9095:9094
environment:
KAFKA_ZOOKEEPER_CONNECT: "zookeeper:32181"
KAFKA_LISTENERS: INTERNAL://kafka-2:9092,OUTSIDE://kafka-2:9094
KAFKA_ADVERTISED_LISTENERS: INTERNAL://kafka-2:9092,OUTSIDE://localhost:9095
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL:PLAINTEXT,OUTSIDE:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL
KAFKA_BROKER_ID: 501
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 3
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ../kafka_data/501:/kafka
networks:
- ompnw
kafka-3:
image: confluentinc/cp-kafka
restart: unless-stopped
logging:
driver: 'gelf'
options:
gelf-address: 'udp://localhost:12201'
tag: kafka-3
depends_on:
- zookeeper
ports:
- 9096:9094
environment:
KAFKA_ZOOKEEPER_CONNECT: "zookeeper:32181"
KAFKA_LISTENERS: INTERNAL://kafka-3:9092,OUTSIDE://kafka-3:9094
KAFKA_ADVERTISED_LISTENERS: INTERNAL://kafka-3:9092,OUTSIDE://localhost:9096
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL:PLAINTEXT,OUTSIDE:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL
KAFKA_BROKER_ID: 502
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 3
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ../kafka_data/502:/kafka
networks:
- ompnw
kafka-ui:
image: obsidiandynamics/kafdrop
restart: unless-stopped
depends_on:
- kafka-1
- kafka-2
- kafka-3
ports:
- 9001:9001
environment:
SERVER_PORT: 9001
KAFKA_BROKERCONNECT: "kafka-1:9092,kafka-2:9092,kafka-3:9092"
JVM_OPTS: "-Xms16M -Xmx48M -Xss180K -XX:-TieredCompilation -XX:+UseStringDeduplication -noverify"
networks:
- ompnw
kafka-ui-2:
image: provectuslabs/kafka-ui:latest
ports:
- 9002:8080
environment:
- KAFKA_CLUSTERS_0_NAME=local
- KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS=kafka-1:9092,kafka-2:9092,kafka-3:9092
- KAFKA_CLUSTERS_0_ZOOKEEPER=zookeeper:32181
swagger-ui:
image: swaggerapi/swagger-ui
ports:
- 8081:8080
restart: always
volumes:
- ./swagger:/swagger
environment:
SWAGGER_JSON: /swagger/ozonmp/com_request_api/v1/com_request_api.swagger.json
depends_on:
- com-request-api
networks:
- ompnw
jaeger:
image: jaegertracing/all-in-one
restart: unless-stopped
logging:
driver: 'gelf'
options:
gelf-address: 'udp://localhost:12201'
tag: jaeger
ports:
- 6831:6831/udp
- 16686:16686
networks:
- ompnw
prometheus:
image: prom/prometheus:latest
restart: unless-stopped
logging:
driver: 'gelf'
options:
gelf-address: 'udp://localhost:12201'
tag: prometheus
ports:
- 9090:9090
networks:
- ompnw
volumes:
- "./prometheus.yml:/etc/prometheus/prometheus.yml"
grafana:
image: grafana/grafana:latest
restart: unless-stopped
depends_on:
- prometheus
ports:
- 3000:3000
links:
- prometheus
environment:
- GF_SECURITY_ADMIN_PASSWORD=MYPASSWORT
- GF_USERS_ALLOW_SIGN_UP=false
networks:
- ompnw
volumes:
- ../grafana_data/grafana:/var/lib/grafana:rw
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch-oss:7.10.2
environment:
- http.host=0.0.0.0
- transport.host=localhost
- network.host=0.0.0.0
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ulimits:
memlock:
soft: -1
hard: -1
deploy:
resources:
limits:
memory: 1g
networks:
- ompnw
volumes:
- esdata:/usr/share/elasticsearch/data
# Elasticsearch: https://www.elastic.co/guide/en/elasticsearch/reference/6.x/docker.html
mongo:
image: mongo:4.2
restart: always
networks:
- ompnw
volumes:
- mongodata:/data/db
# Graylog: https://hub.docker.com/r/graylog/graylog/
graylog:
image: graylog/graylog:4.2
environment:
# CHANGE ME (must be at least 16 characters)!
- GRAYLOG_PASSWORD_SECRET=somepasswordpepper
# Password: admin
- GRAYLOG_ROOT_PASSWORD_SHA2=8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918
- GRAYLOG_HTTP_EXTERNAL_URI=http://127.0.0.1:9000/
entrypoint: /usr/bin/tini -- wait-for-it elasticsearch:9200 -- /docker-entrypoint.sh
networks:
- ompnw
links:
- mongo
- elasticsearch
depends_on:
- mongo
- elasticsearch
ports:
# Graylog web interface and REST API
- 9000:9000
# Syslog TCP
- 1514:1514
# Syslog UDP
- 1514:1514/udp
# GELF TCP
- 12201:12201
# GELF UDP
- 12201:12201/udp
restart: always
volumes:
pgdata:
driver: local
esdata:
driver: local
mongodata:
driver: local
networks:
ompnw:
driver: bridge