-
Notifications
You must be signed in to change notification settings - Fork 4
/
docker-compose.yml
275 lines (261 loc) · 11 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
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
version: '3.8'
services:
dynamodb:
image: amazon/dynamodb-local:latest
volumes:
- ./.data/dynamodb:/data:delegated
ports:
- 8000:8000
command: ['-jar', 'DynamoDBLocal.jar', '-sharedDb', '-inMemory']
redis:
image: redis:latest
ports:
- 6379:6379
volumes:
- ./.data/redis:/data
redis-ui:
image: redislabs/redisinsight:latest
ports:
- 8081:8001
depends_on:
- redis
volumes:
- ./.data/redisinsight:/db
mysql:
image: mysql:latest
ports:
- 3307:3306
volumes:
- ./.data/mysql:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: integration-test
MYSQL_DATABASE: database
mongo:
image: mongo:latest
volumes:
- ./.data/mongo:/data/db:delegated
ports:
- 27017:27017
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: integration-test
elasticsearch-setup:
image: elasticsearch:8.11.3
volumes:
- ./.data/elastic-certs:/usr/share/elasticsearch/config/certs
user: '0'
command: >
bash -c '
if [ ! -f config/certs/ca.zip ]; then
echo "Creating CA";
bin/elasticsearch-certutil ca --silent --pem -out config/certs/ca.zip;
unzip config/certs/ca.zip -d config/certs;
fi;
if [ ! -f config/certs/certs.zip ]; then
echo "Creating certs";
echo -ne \
"instances:\n"\
" - name: elasticsearch\n"\
" dns:\n"\
" - elasticsearch\n"\
" - localhost\n"\
" ip:\n"\
" - 127.0.0.1\n"\
" - name: kibana\n"\
" dns:\n"\
" - kibana\n"\
" - localhost\n"\
" ip:\n"\
" - 127.0.0.1\n"\
> config/certs/instances.yml;
bin/elasticsearch-certutil cert --silent --pem -out config/certs/certs.zip --in config/certs/instances.yml --ca-cert config/certs/ca/ca.crt --ca-key config/certs/ca/ca.key;
unzip config/certs/certs.zip -d config/certs;
fi;
echo "Setting file permissions"
chown -R root:root config/certs;
find . -type d -exec chmod 750 \{\} \;;
find . -type f -exec chmod 640 \{\} \;;
echo "Waiting for Elasticsearch availability";
until curl -s --cacert config/certs/ca/ca.crt https://elasticsearch:9200 | grep -q "missing authentication credentials"; do sleep 30; done;
echo "Setting kibana_system password";
until curl -s -X POST --cacert config/certs/ca/ca.crt -u "elastic:integration-test" -H "Content-Type: application/json" https://elasticsearch:9200/_security/user/kibana_system/_password -d "{\"password\":\"integration-test\"}" | grep -q "^{}"; do sleep 10; done;
echo "All done!";
'
healthcheck:
test: ['CMD-SHELL', '[ -f config/certs/elasticsearch/elasticsearch.crt ]']
interval: 1s
timeout: 5s
retries: 120
elasticsearch:
image: elasticsearch:8.11.3
depends_on:
elasticsearch-setup:
condition: service_healthy
environment:
- node.name=elasticsearch
- discovery.type=single-node
- bootstrap.memory_lock=true
- 'ES_JAVA_OPTS=-Xms512m -Xmx512m'
- ELASTIC_PASSWORD=integration-test
- xpack.security.enabled=true
- xpack.security.http.ssl.enabled=true
- xpack.security.http.ssl.key=certs/elasticsearch/elasticsearch.key
- xpack.security.http.ssl.certificate=certs/elasticsearch/elasticsearch.crt
- xpack.security.http.ssl.certificate_authorities=certs/ca/ca.crt
- xpack.security.transport.ssl.enabled=true
- xpack.security.transport.ssl.key=certs/elasticsearch/elasticsearch.key
- xpack.security.transport.ssl.certificate=certs/elasticsearch/elasticsearch.crt
- xpack.security.transport.ssl.certificate_authorities=certs/ca/ca.crt
- xpack.security.transport.ssl.verification_mode=certificate
- xpack.license.self_generated.type=basic
mem_limit: 1g
volumes:
- ./.data/elastic-certs:/usr/share/elasticsearch/config/certs
- ./.data/elastic:/usr/share/elasticsearch/data
ports:
- 9200:9200
healthcheck:
test:
[
'CMD-SHELL',
'curl --cacert config/certs/ca/ca.crt -s -f -u elastic:integration-test https://localhost:9200/_cluster/health >/dev/null || exit 1',
]
interval: 10s
timeout: 10s
retries: 120
kibana:
image: kibana:8.11.3
depends_on:
elasticsearch:
condition: service_healthy
environment:
SERVERNAME: kibana
ELASTICSEARCH_HOSTS: https://elasticsearch:9200
ELASTICSEARCH_USERNAME: kibana_system
ELASTICSEARCH_PASSWORD: integration-test
ELASTICSEARCH_SSL_CERTIFICATEAUTHORITIES: config/certs/ca/ca.crt
XPACK_SECURITY_ENCRYPTIONKEY: c34d38b3a14956121ff2170e5030b471551370178f43e5626eec58b04a30fae2
XPACK_ENCRYPTEDSAVEDOBJECTS_ENCRYPTIONKEY: c34d38b3a14956121ff2170e5030b471551370178f43e5626eec58b04a30fae2
XPACK_REPORTING_ENCRYPTIONKEY: c34d38b3a14956121ff2170e5030b471551370178f43e5626eec58b04a30fae2
volumes:
- ./.data/elastic-certs:/usr/share/kibana/config/certs
- ./.data/kibana:/usr/share/kibana/data
ports:
- 5601:5601
healthcheck:
test: ['CMD-SHELL', "curl -s -I http://localhost:5601 | grep -q 'HTTP/1.1 302 Found'"]
interval: 10s
timeout: 10s
retries: 120
opensearch-node1:
image: opensearchproject/opensearch:latest
environment:
- cluster.name=opensearch-cluster
- node.name=opensearch-node1
- discovery.seed_hosts=opensearch-node1,opensearch-node2
- cluster.initial_cluster_manager_nodes=opensearch-node1,opensearch-node2
- bootstrap.memory_lock=true
- 'OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m'
- 'DISABLE_INSTALL_DEMO_CONFIG=true' # Prevents execution of bundled demo script which installs demo certificates and security configurations to OpenSearch
- 'DISABLE_SECURITY_PLUGIN=true' # Disables Security plugin
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536
hard: 65536
volumes:
- ./.data/opensearch-node1:/usr/share/opensearch/data
ports:
- 9201:9200
- 9600:9600
healthcheck:
test: ['CMD-SHELL', 'curl -s -f http://localhost:9200/_cluster/health >/dev/null || exit 1']
interval: 10s
timeout: 10s
retries: 120
opensearch-node2:
image: opensearchproject/opensearch:latest
environment:
- cluster.name=opensearch-cluster
- node.name=opensearch-node2
- discovery.seed_hosts=opensearch-node1,opensearch-node2
- cluster.initial_cluster_manager_nodes=opensearch-node1,opensearch-node2
- bootstrap.memory_lock=true
- 'OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m'
- 'DISABLE_INSTALL_DEMO_CONFIG=true' # Prevents execution of bundled demo script which installs demo certificates and security configurations to OpenSearch
- 'DISABLE_SECURITY_PLUGIN=true' # Disables Security plugin
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536
hard: 65536
volumes:
- ./.data/opensearch-node2:/usr/share/opensearch/data
healthcheck:
test: ['CMD-SHELL', 'curl -s -f http://localhost:9200/_cluster/health >/dev/null || exit 1']
interval: 10s
timeout: 10s
retries: 120
opensearch-dashboard:
image: opensearchproject/opensearch-dashboards:latest
depends_on:
opensearch-node1:
condition: service_healthy
opensearch-node2:
condition: service_healthy
ports:
- 5602:5601
environment:
OPENSEARCH_HOSTS: '["http://opensearch-node1:9200","http://opensearch-node2:9200"]'
DISABLE_SECURITY_DASHBOARDS_PLUGIN: true # disables security dashboards plugin in OpenSearch Dashboards
healthcheck:
test: ['CMD-SHELL', "curl -s -I http://localhost:5601 | grep -q 'HTTP/1.1 302 Found'"]
interval: 10s
timeout: 10s
retries: 120
kafka:
image: confluentinc/cp-kafka:latest
ports:
- '9092:9092'
- '9101:9101'
environment:
KAFKA_NODE_ID: 1
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: 'CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT'
KAFKA_ADVERTISED_LISTENERS: 'PLAINTEXT://kafka:29092,PLAINTEXT_HOST://localhost:9092'
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
KAFKA_JMX_PORT: 9101
KAFKA_JMX_HOSTNAME: localhost
KAFKA_PROCESS_ROLES: 'broker,controller'
KAFKA_CONTROLLER_QUORUM_VOTERS: '1@kafka:29093'
KAFKA_LISTENERS: 'PLAINTEXT://kafka:29092,CONTROLLER://kafka:29093,PLAINTEXT_HOST://0.0.0.0:9092'
KAFKA_INTER_BROKER_LISTENER_NAME: 'PLAINTEXT'
KAFKA_CONTROLLER_LISTENER_NAMES: 'CONTROLLER'
KAFKA_LOG_DIRS: '/tmp/kraft-combined-logs'
# Replace CLUSTER_ID with a unique base64 UUID using "bin/kafka-storage.sh random-uuid"
# See https://docs.confluent.io/kafka/operations-tools/kafka-tools.html#kafka-storage-sh
CLUSTER_ID: 'WZEKwK-b123oT3ZOSU0dgw'
kafka-ui:
image: provectuslabs/kafka-ui:latest
ports:
- 8080:8080
depends_on:
- kafka
environment:
DYNAMIC_CONFIG_ENABLED: 'true'
KAFKA_CLUSTERS_0_NAME: dockerized-kafka
KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: kafka:29092
rabbitmq:
image: rabbitmq:3.12-management
ports:
- 5672:5672
- 15672:15672
environment:
RABBITMQ_DEFAULT_USER: root
RABBITMQ_DEFAULT_PASS: integration-test