-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yaml
288 lines (272 loc) · 6.98 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
version: "3.9"
services:
srv-verification-api:
build:
context: .
dockerfile: Dockerfile
restart: unless-stopped
logging:
driver: 'gelf'
options:
gelf-address: 'udp://localhost:12201'
tag: srv-verification-api
networks:
- srvnw
depends_on:
- postgres
- kafka-1
- kafka-2
links:
- postgres
- kafka-1
- kafka-2
ports:
- 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:/root/migrations
- ./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: srv_verification_api
APP_DB_USER: docker
APP_DB_PASS: docker
networks:
- srvnw
volumes:
# - pgdata:/var/lib/postgresql/data
- ./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:
- srvnw
kafka-1:
image: confluentinc/cp-kafka
restart: unless-stopped
logging:
driver: 'gelf'
options:
gelf-address: 'udp://localhost:12201'
tag: kafka
depends_on:
- zookeeper
ports:
- 9095: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_OFFSETS_TOPIC_REPLICATION_FACTOR: 2
command: sh -c "((sleep 15 && kafka-topics --create --zookeeper zookeeper:32181 --replication-factor 1 --partitions 1 --topic templates)&) && /etc/confluent/docker/run"
networks:
- srvnw
kafka-2:
image: confluentinc/cp-kafka
restart: unless-stopped
logging:
driver: 'gelf'
options:
gelf-address: 'udp://localhost:12201'
tag: kafka
depends_on:
- zookeeper
ports:
- 9096: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:9094
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL:PLAINTEXT,OUTSIDE:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 2
command: sh -c "((sleep 15 && kafka-topics --create --zookeeper zookeeper:32181 --replication-factor 1 --partitions 1 --topic templates)&) && /etc/confluent/docker/run"
networks:
- srvnw
kafka-ui:
image: obsidiandynamics/kafdrop
restart: unless-stopped
depends_on:
- kafka-1
- kafka-2
ports:
- 9001:9001
environment:
SERVER_PORT: 9001
KAFKA_BROKERCONNECT: kafka-1:9092, kafka-2:9092
JVM_OPTS: "-Xms16M -Xmx48M -Xss180K -XX:-TieredCompilation -XX:+UseStringDeduplication -noverify"
networks:
- srvnw
swagger-ui:
image: swaggerapi/swagger-ui
restart: always
volumes:
- ./swagger:/swagger
environment:
SWAGGER_JSON: /swagger/ozonmp/srv_verification_api/v1/srv_verification_api.swagger.json
BASE_URL: /swagger
depends_on:
- srv-verification-api
networks:
- srvnw
jaeger:
image: jaegertracing/all-in-one
restart: unless-stopped
logging:
driver: 'gelf'
options:
gelf-address: 'udp://localhost:12201'
tag: jaeger
ports:
- 6832:6832/udp
- 16686:16686
networks:
- srvnw
prometheus:
image: prom/prometheus:latest
restart: unless-stopped
logging:
driver: 'gelf'
options:
gelf-address: 'udp://localhost:12201'
tag: prometheus
ports:
- 9090:9090
networks:
- srvnw
volumes:
- "./prometheus.yml:/etc/prometheus/prometheus.yml"
grafana:
image: grafana/grafana:latest
restart: unless-stopped
ports:
- 3000:3000
links:
- prometheus
environment:
- GF_SECURITY_ADMIN_PASSWORD=MYPASSWORT
- GF_USERS_ALLOW_SIGN_UP=false
networks:
- srvnw
volumes:
- "./data/grafana:/var/lib/grafana"
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:
- srvnw
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:
- srvnw
volumes:
- mongodata:/data/db
# Graylog: https://hub.docker.com/r/graylog/graylog/
graylog:
image: graylog/graylog:4.0
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:
- srvnw
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
nginx:
image: nginx:latest
depends_on:
- srv-verification-api
- swagger-ui
links:
- srv-verification-api
- swagger-ui
restart: always
networks:
- srvnw
ports:
- 8080:80
volumes:
- ./nginx.conf:/etc/nginx/conf.d/default.conf
volumes:
pgdata:
driver: local
esdata:
driver: local
mongodata:
driver: local
networks:
srvnw:
driver: bridge