-
Notifications
You must be signed in to change notification settings - Fork 71
/
Copy pathdocker-compose.yml
250 lines (233 loc) · 10.1 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
---
version: '2'
services:
zookeeper:
image: confluentinc/cp-zookeeper:7.0.0-1-ubi8
restart: always
container_name: zookeeper
ports:
- 2181:2181
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
kafka:
image: confluentinc/cp-enterprise-kafka:7.0.0-1-ubi8
restart: always
container_name: kafka
ports:
- 9092:9092
environment:
KAFKA_BROKER_ID: 101
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_METRIC_REPORTERS: "io.confluent.metrics.reporter.ConfluentMetricsReporter"
KAFKA_AUTO_CREATE_TOPICS_ENABLE: "false"
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
KAFKA_LOG_RETENTION_HOURS: 1
KAFKA_LOG_SEGMENT_BYTES: 536870912
KAFKA_LOG_RETENTION_BYTES: 536870912
CONFLUENT_METRICS_REPORTER_BOOTSTRAP_SERVERS: "kafka:9092"
CONFLUENT_METRICS_REPORTER_TOPIC_REPLICAS: 1
schema-registry:
image: confluentinc/cp-schema-registry:7.0.0-1-ubi8
restart: always
container_name: schema-registry
ports:
- "8081:8081"
environment:
SCHEMA_REGISTRY_HOST_NAME: schema-registry
SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS: 'kafka:9092'
KAFKA_REST_CUB_KAFKA_TIMEOUT: 180 # https://github.com/confluentinc/cp-docker-images/issues/807
ksqldb-server:
image: confluentinc/cp-ksqldb-server:7.0.0-1-ubi8
restart: always
container_name: ksqldb-server
ports:
- "8088:8088"
environment:
KSQL_CONFIG_DIR: "/etc/ksql"
KSQL_LOG4J_OPTS: "-Dlog4j.configuration=file:/etc/ksql/log4j-rolling.properties"
KSQL_BOOTSTRAP_SERVERS: "kafka:9092"
KSQL_HOST_NAME: ksqldb
KSQL_APPLICATION_ID: "dev-class"
KSQL_KSQL_CONNECT_URL: http://connect:8083/
KSQL_LISTENERS: "http://0.0.0.0:8088"
KSQL_CACHE_MAX_BYTES_BUFFERING: 0
KSQL_KSQL_SCHEMA_REGISTRY_URL: "http://schema-registry:8081"
KSQL_PRODUCER_INTERCEPTOR_CLASSES: "io.confluent.monitoring.clients.interceptor.MonitoringProducerInterceptor"
KSQL_CONSUMER_INTERCEPTOR_CLASSES: "io.confluent.monitoring.clients.interceptor.MonitoringConsumerInterceptor"
KSQL_KSQL_LOGGING_PROCESSING_STREAM_AUTO_CREATE: "true"
KSQL_KSQL_LOGGING_PROCESSING_TOPIC_AUTO_CREATE: "true"
connect:
image: confluentinc/cp-kafka-connect:7.0.0-1-ubi8
restart: always
container_name: connect
ports:
- "8083:8083"
environment:
CONNECT_REST_PORT: 8083
CONNECT_BOOTSTRAP_SERVERS: kafka:9092
CONNECT_GROUP_ID: "connect"
CONNECT_CONFIG_STORAGE_TOPIC: "connect-config"
CONNECT_OFFSET_STORAGE_TOPIC: "connect-offsets"
CONNECT_STATUS_STORAGE_TOPIC: "connect-status"
CONNECT_REPLICATION_FACTOR: 1
CONNECT_CONFIG_STORAGE_REPLICATION_FACTOR: 1
CONNECT_OFFSET_STORAGE_REPLICATION_FACTOR: 1
CONNECT_STATUS_STORAGE_REPLICATION_FACTOR: 1
CONNECT_KEY_CONVERTER: "org.apache.kafka.connect.storage.StringConverter"
CONNECT_VALUE_CONVERTER: "io.confluent.connect.avro.AvroConverter"
CONNECT_VALUE_CONVERTER_SCHEMA_REGISTRY_URL: "http://schema-registry:8081"
CONNECT_INTERNAL_KEY_CONVERTER: "org.apache.kafka.connect.json.JsonConverter"
CONNECT_INTERNAL_VALUE_CONVERTER: "org.apache.kafka.connect.json.JsonConverter"
CONNECT_PLUGIN_PATH: '/usr/share/java,/usr/share/confluent-hub-components/,/data/connect-jars'
CONNECT_REST_ADVERTISED_HOST_NAME: "connect"
CONNECT_PRODUCER_INTERCEPTOR_CLASSES: io.confluent.monitoring.clients.interceptor.MonitoringProducerInterceptor
CONNECT_CONSUMER_INTERCEPTOR_CLASSES: io.confluent.monitoring.clients.interceptor.MonitoringConsumerInterceptor
control-center:
image: confluentinc/cp-enterprise-control-center:7.0.0-1-ubi8
restart: always
container_name: control-center
ports:
- "9021:9021"
environment:
CONTROL_CENTER_BOOTSTRAP_SERVERS: kafka:9092
CONTROL_CENTER_ZOOKEEPER_CONNECT: zookeeper:2181
CONTROL_CENTER_REPLICATION_FACTOR: 1
CONTROL_CENTER_MONITORING_INTERCEPTOR_TOPIC_REPLICATION: 1
CONTROL_CENTER_INTERNAL_TOPICS_REPLICATION: 1
CONTROL_CENTER_COMMAND_TOPIC_REPLICATION: 1
CONTROL_CENTER_METRICS_TOPIC_REPLICATION: 1
CONTROL_CENTER_STREAMS_NUM_STREAM_THREADS: 1
CONTROL_CENTER_STREAMS_CONSUMER_REQUEST_TIMEOUT_MS: "960032"
CONTROL_CENTER_SCHEMA_REGISTRY_URL: "http://schema-registry:8081"
CONTROL_CENTER_CONNECT_CONNECT_CLUSTER: "connect:8083"
CONTROL_CENTER_KSQL_KSQLDB_URL: "http://ksqldb-server:8088"
CONTROL_CENTER_UI_AUTOUPDATE_ENABLE: "false"
producer1:
image: cnfltraining/java-producer-avro:1.0
container_name: producer1
environment:
DRIVER_ID: driver-1
command: "bash -c 'until curl -fsSL schema-registry:8081/subjects/ ; \
do sleep 1; \
echo waiting for schema; \
done; \
java -classpath \"lib/*\" clients.Producer'"
producer2:
image: cnfltraining/java-producer-avro:1.0
container_name: producer2
environment:
DRIVER_ID: driver-2
command: "bash -c 'until curl -fsSL schema-registry:8081/subjects/ ; \
do sleep 1; \
echo waiting for schema; \
done; \
java -classpath \"lib/*\" clients.Producer'"
producer3:
image: cnfltraining/java-producer-avro:1.0
container_name: producer3
environment:
DRIVER_ID: driver-3
command: "bash -c 'until curl -fsSL schema-registry:8081/subjects/ ; \
do sleep 1; \
echo waiting for schema; \
done; \
java -classpath \"lib/*\" clients.Producer'"
producer4:
image: cnfltraining/java-producer-avro:1.0
container_name: producer4
environment:
DRIVER_ID: driver-4
command: "bash -c 'until curl -fsSL schema-registry:8081/subjects/ ; \
do sleep 1; \
echo waiting for schema; \
done; \
java -classpath \"lib/*\" clients.Producer'"
producer5:
image: cnfltraining/java-producer-avro:1.0
container_name: producer5
environment:
DRIVER_ID: driver-5
command: "bash -c 'until curl -fsSL schema-registry:8081/subjects/ ; \
do sleep 1; \
echo waiting for schema; \
done; \
java -classpath \"lib/*\" clients.Producer'"
webserver:
image: cnfltraining/node-webserver:1.0
container_name: webserver
hostname: webserver
ports:
- 3001:3000
command: "bash -c 'until kafkacat -b kafka:9092 -L | grep driver-positions; \
do sleep 1; \
echo waiting for topic; \
done; \
npm run start'"
webserver-avro:
image: cnfltraining/node-webserver-avro:1.0
container_name: webserver-avro
hostname: webserver-avro
ports:
- 3002:3000
environment:
TOPIC: driver-positions-avro
command: "bash -c 'until curl -fsSL schema-registry:8081/subjects/ | grep driver-positions-avro-value ; \
do sleep 1; \
echo waiting for schema; \
done; \
npm run start'"
webserver-streams:
image: cnfltraining/node-webserver-avro:2.0
container_name: webserver-streams
hostname: webserver-streams
ports:
- 3003:3000
environment:
TOPIC: driver-positions-string-avro
command: "bash -c 'until curl -fsSL schema-registry:8081/subjects/ | grep driver-positions-string-avro-value ; \
do sleep 1; \
echo waiting for schema; \
done; \
npm run start'"
webserver-ksql:
image: cnfltraining/node-webserver-avro:1.0
container_name: webserver-ksql
hostname: webserver-ksql
ports:
- 3004:3000
environment:
TOPIC: driver-augmented-avro
command: "bash -c 'until curl -fsSL schema-registry:8081/subjects/ | grep driver-augmented-avro-value ; \
do sleep 1; \
echo waiting for schema; \
done; \
npm run start'"
postgres:
image: postgres:11.2-alpine
restart: always
container_name: postgres
volumes:
- ./postgres/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
ports:
- 5432:5432
create-topics:
image: confluentinc/cp-enterprise-kafka:7.0.0-1-ubi8
container_name: create-topics
command: >
bash -c 'echo Waiting for Kafka to be ready... ;
cub kafka-ready -b kafka:9092 1 300 ;
echo Creating topics... ;
kafka-topics --bootstrap-server kafka:9092 --create --topic driver-positions --partitions 3 --replication-factor 1 ;
kafka-topics --bootstrap-server kafka:9092 --create --topic driver-profiles-avro --partitions 3 --replication-factor 1 --config cleanup.policy=compact ;
kafka-topics --bootstrap-server kafka:9092 --create --topic driver-profiles-protobuf --partitions 3 --replication-factor 1 --config cleanup.policy=compact ;
kafka-topics --bootstrap-server kafka:9092 --create --topic driver-profiles-ksql --partitions 3 --replication-factor 1 --config cleanup.policy=compact ;
kafka-topics --bootstrap-server kafka:9092 --create --topic driver-positions-avro --partitions 3 --replication-factor 1 ;
kafka-topics --bootstrap-server kafka:9092 --create --topic driver-distance-avro --partitions 3 --replication-factor 1 ;
kafka-topics --bootstrap-server kafka:9092 --create --topic driver-augmented-avro --partitions 3 --replication-factor 1 ;
kafka-topics --bootstrap-server kafka:9092 --create --topic _confluent-monitoring --partitions 12 --replication-factor 1 --config retention.ms=259200000 --config message.timestamp.type=LogAppendTime ;
kafka-topics --bootstrap-server kafka:9092 --create --topic driver-positions-string-avro --partitions 3 --replication-factor 1 ;
true'