-
Notifications
You must be signed in to change notification settings - Fork 3
/
docker-compose.yml
221 lines (207 loc) · 6.91 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
services:
kafka1:
image: confluentinc/cp-kafka:${CONFLUENT_VERSION}
environment:
KAFKA_NODE_ID: 1
KAFKA_ADVERTISED_LISTENERS: INTERNAL://kafka1:9092,EXTERNAL://localhost:19092
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL
KAFKA_CONTROLLER_LISTENER_NAMES: CONTROLLER
KAFKA_LISTENERS: CONTROLLER://0.0.0.0:9093,INTERNAL://0.0.0.0:9092,EXTERNAL://0.0.0.0:19092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: CONTROLLER:PLAINTEXT,INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT
CLUSTER_ID: ${CLUSTER_ID}
KAFKA_PROCESS_ROLES: broker,controller
KAFKA_CONTROLLER_QUORUM_VOTERS: 1@kafka1:9093,2@kafka2:9093,3@kafka3:9093
KAFKA_LOG_DIRS: /var/lib/kafka/data
ports:
- "19092:19092"
restart: on-failure
volumes:
- kafka1_data:/var/lib/kafka/data
kafka2:
image: confluentinc/cp-kafka:${CONFLUENT_VERSION}
environment:
KAFKA_NODE_ID: 2
KAFKA_ADVERTISED_LISTENERS: INTERNAL://kafka2:9092,EXTERNAL://localhost:29092
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL
KAFKA_CONTROLLER_LISTENER_NAMES: CONTROLLER
KAFKA_LISTENERS: CONTROLLER://0.0.0.0:9093,INTERNAL://0.0.0.0:9092,EXTERNAL://0.0.0.0:29092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: CONTROLLER:PLAINTEXT,INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT
CLUSTER_ID: ${CLUSTER_ID}
KAFKA_PROCESS_ROLES: broker,controller
KAFKA_CONTROLLER_QUORUM_VOTERS: 1@kafka1:9093,2@kafka2:9093,3@kafka3:9093
KAFKA_LOG_DIRS: /var/lib/kafka/data
ports:
- "29092:29092"
restart: on-failure
volumes:
- kafka2_data:/var/lib/kafka/data
kafka3:
image: confluentinc/cp-kafka:${CONFLUENT_VERSION}
environment:
KAFKA_NODE_ID: 3
KAFKA_ADVERTISED_LISTENERS: INTERNAL://kafka3:9092,EXTERNAL://localhost:39092
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL
KAFKA_CONTROLLER_LISTENER_NAMES: CONTROLLER
KAFKA_LISTENERS: CONTROLLER://0.0.0.0:9093,INTERNAL://0.0.0.0:9092,EXTERNAL://0.0.0.0:39092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: CONTROLLER:PLAINTEXT,INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT
CLUSTER_ID: ${CLUSTER_ID}
KAFKA_PROCESS_ROLES: broker,controller
KAFKA_CONTROLLER_QUORUM_VOTERS: 1@kafka1:9093,2@kafka2:9093,3@kafka3:9093
KAFKA_LOG_DIRS: /var/lib/kafka/data
ports:
- "39092:39092"
restart: on-failure
volumes:
- kafka3_data:/var/lib/kafka/data
schema-registry:
image: confluentinc/cp-schema-registry:${CONFLUENT_VERSION}
environment:
SCHEMA_REGISTRY_ACCESS_CONTROL_ALLOW_METHODS: GET,POST,PUT,OPTIONS
SCHEMA_REGISTRY_ACCESS_CONTROL_ALLOW_ORIGIN: "*"
SCHEMA_REGISTRY_DEBUG: "true"
SCHEMA_REGISTRY_HOST_NAME: localhost
SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS: kafka1:9092,kafka2:9092,kafka3:9092
SCHEMA_REGISTRY_KAFKASTORE_TOPIC: registry.schemas
ports:
- "8081:8081"
restart: on-failure
kafka-connect:
image: confluentinc/cp-kafka-connect:${CONFLUENT_VERSION}
environment:
CONNECT_BOOTSTRAP_SERVERS: kafka1:9092,kafka2:9092,kafka3:9092
CONNECT_REST_ADVERTISED_HOST_NAME: localhost
CONNECT_REST_PORT: 8083
CONNECT_GROUP_ID: kafka-connect-sandbox
CONNECT_PLUGIN_PATH: /usr/local/share/kafka/plugins
CONNECT_KEY_CONVERTER: io.confluent.connect.avro.AvroConverter
CONNECT_VALUE_CONVERTER: io.confluent.connect.avro.AvroConverter
CONNECT_KEY_CONVERTER_SCHEMA_REGISTRY_URL: http://schema-registry:8081
CONNECT_VALUE_CONVERTER_SCHEMA_REGISTRY_URL: http://schema-registry:8081
CONNECT_CONFIG_STORAGE_TOPIC: connect.config
CONNECT_OFFSET_STORAGE_TOPIC: connect.offsets
CONNECT_STATUS_STORAGE_TOPIC: connect.status
ports:
- "8083:8083"
restart: on-failure
volumes:
- ./kafka-connect/plugins:/usr/local/share/kafka/plugins
akhq:
image: tchiotludo/akhq:latest
ports:
- "8080:8080"
restart: on-failure
environment:
AKHQ_CONFIGURATION: |
akhq:
connections:
kafka:
properties:
bootstrap.servers: kafka1:9092,kafka2:9092,kafka3:9092
schema-registry:
url: http://schema-registry:8081
connect:
- name: kafka-connect
url: http://kafka-connect:8083
ksqldb:
- name: "ksqldb"
url: "http://ksqldb:8088"
mysql:
image: mysql:latest
profiles:
- sql
environment:
MYSQL_DATABASE: ${DB_NAME}
MYSQL_ROOT_PASSWORD: ${DB_PASSWORD}
ports:
- "3306:3306"
restart: on-failure
volumes:
- mysql_data:/var/lib/mysql
postgres:
image: postgres:latest
profiles:
- sql
environment:
POSTGRES_DB: ${DB_NAME}
POSTGRES_PASSWORD: ${DB_PASSWORD}
ports:
- "5432:5432"
restart: on-failure
volumes:
- postgres_data:/var/lib/postgresql/data
adminer:
image: adminer:latest
profiles:
- sql
ports:
- "9090:8080"
restart: on-failure
mosquitto:
image: eclipse-mosquitto:latest
profiles:
- mqtt
ports:
- "1883:1883"
restart: on-failure
volumes:
- ./mosquitto.conf:/mosquitto/config/mosquitto.conf
- mosquitto_data:/mosquitto/data
kafka-rest:
image: confluentinc/cp-kafka-rest:${CONFLUENT_VERSION}
profiles:
- proxies
environment:
KAFKA_REST_BOOTSTRAP_SERVERS: kafka1:9092,kafka2:9092,kafka3:9092
KAFKA_REST_SCHEMA_REGISTRY_URL: http://schema-registry:8081
ports:
- "8082:8082"
restart: on-failure
kafka-mqtt:
image: confluentinc/cp-kafka-mqtt:${CONFLUENT_VERSION}
profiles:
- proxies
environment:
KAFKA_MQTT_BOOTSTRAP_SERVERS: kafka1:9092,kafka2:9092,kafka3:9092
KAFKA_MQTT_TOPIC_REGEX_LIST: proxy.mqtt:.*
KAFKA_MQTT_LISTENERS: 0.0.0.0:1884
ports:
- "1884:1884"
restart: on-failure
ksqldb:
image: confluentinc/cp-ksqldb-server:${CONFLUENT_VERSION}
environment:
KSQL_KSQL_SERVICE_ID: ksqldb.
KSQL_LISTENERS: http://0.0.0.0:8088
KSQL_BOOTSTRAP_SERVERS: kafka1:9092,kafka2:9092,kafka3:9092
KSQL_KSQL_LOGGING_PROCESSING_STREAM_AUTO_CREATE: "true"
KSQL_KSQL_LOGGING_PROCESSING_TOPIC_AUTO_CREATE: "true"
KSQL_KSQL_SCHEMA_REGISTRY_URL: http://schema-registry:8081
KSQL_KSQL_CONNECT_URL: http://kafka-connect:8083
KSQL_KSQL_EXTENSION_DIR: /ksqldb/extensions
ports:
- "8088:8088"
restart: on-failure
volumes:
- ./kafka-ksqldb-extensions/extensions:/ksqldb/extensions
cli:
build:
context: .
args:
CONFLUENT_VERSION: ${CONFLUENT_VERSION}
environment:
PGPASSWORD: ${DB_PASSWORD}
MYSQL_PWD: ${DB_PASSWORD}
CLUSTER_ID: ${CLUSTER_ID}
volumes:
- .:/kafka-sandbox
- gradle_cache:/home/ubuntu/.gradle
entrypoint: /bin/bash
tty: true
volumes:
kafka1_data:
kafka2_data:
kafka3_data:
mysql_data:
postgres_data:
mosquitto_data:
gradle_cache: