-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
185 lines (179 loc) · 5.52 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
version: '3'
services:
zookeeper:
image: confluentinc/cp-zookeeper:7.3.2
restart: always
container_name: zookeeper
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
ports:
- "127.0.0.1:2181:2181"
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "10"
kafka-broker-1:
image: confluentinc/cp-kafka:7.3.2
restart: always
hostname: kafka-broker-1
ports:
- "127.0.0.1:19092:19092"
depends_on:
- zookeeper
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: 'zookeeper:2181'
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka-broker-1:19092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "10"
schema-registry:
image: confluentinc/cp-schema-registry:7.3.2
restart: always
hostname: schema-registry
depends_on:
- zookeeper
- kafka-broker-1
ports:
- "127.0.0.1:8081:8081"
environment:
SCHEMA_REGISTRY_HOST_NAME: schema-registry
SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL: 'zookeeper:2181'
SCHEMA_REGISTRY_LISTENERS: http://0.0.0.0:8081
SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS: kafka-broker-1:19092
SCHEMA_REGISTRY_DEBUG: 'true'
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "10"
kafka-rest:
image: confluentinc/cp-kafka-rest:7.3.2
restart: always
container_name: kafka-rest
depends_on:
- zookeeper
- kafka-broker-1
ports:
- "127.0.0.1:8082:8082"
environment:
KAFKAREST_HEAP_OPTS: "-Xmx256M"
KAFKA_REST_ID: kafka-rest-server
KAFKA_REST_LISTENERS: http://0.0.0.0:8082
KAFKA_REST_SCHEMA_REGISTRY_URL: http://0.0.0.0:8081
KAFKA_REST_BOOTSTRAP_SERVERS: kafka-broker-1:19092
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "10"
kafka-connect:
image: confluentinc/cp-kafka-connect:7.3.2
restart: always
container_name: kafka-connect
ports:
- "127.0.0.1:8083:8083"
depends_on:
- zookeeper
- kafka-broker-1
- schema-registry
environment:
CONNECT_BOOTSTRAP_SERVERS: kafka-broker-1:19092
CONNECT_REST_PORT: 8083
CONNECT_REST_ADVERTISED_HOST_NAME: kafka-connect
CONNECT_GROUP_ID: kafka-connect-group
CONNECT_CONFIG_STORAGE_TOPIC: docker-connect-configs
CONNECT_OFFSET_STORAGE_TOPIC: docker-connect-offsets
CONNECT_STATUS_STORAGE_TOPIC: docker-connect-status
CONNECT_CONFIG_STORAGE_REPLICATION_FACTOR: "1"
CONNECT_OFFSET_STORAGE_REPLICATION_FACTOR: "1"
CONNECT_STATUS_STORAGE_REPLICATION_FACTOR: "1"
CONNECT_KEY_CONVERTER: io.confluent.connect.avro.AvroConverter
CONNECT_KEY_CONVERTER_SCHEMA_REGISTRY_URL: 'http://schema-registry:8081'
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_LOG4J_ROOT_LOGLEVEL: "INFO"
CONNECT_LOG4J_LOGGERS: "org.apache.kafka.connect.runtime.rest=WARN,org.reflections=ERROR"
CONNECT_PLUGIN_PATH: '/usr/share/java,/etc/kafka-connect/jars,/usr/share/confluent-hub-components'
volumes:
- ./connectors:/etc/kafka-connect/jars/
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "10"
command:
- bash
- -c
- |
confluent-hub install --no-prompt debezium/debezium-connector-postgresql:2.2.1
confluent-hub install --no-prompt confluentinc/kafka-connect-datagen:0.4.0
/etc/confluent/docker/run
kafka-ui:
container_name: kafka-ui
image: provectuslabs/kafka-ui:latest
restart: always
ports:
- "127.0.0.1:6680:6680"
depends_on:
- zookeeper
- kafka-broker-1
- schema-registry
- kafka-rest
- kafka-connect
environment:
SERVER_PORT: 6680
LOGGING_LEVEL_ROOT: info
KAFKA_CLUSTERS_0_NAME: Kafka-Cluster
KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: kafka-broker-1:19092
KAFKA_CLUSTERS_0_ZOOKEEPER: zookeeper:2181
KAFKA_CLUSTERS_0_SCHEMAREGISTRY: http://schema-registry:8081
KAFKA_CLUSTERS_0_KAFKACONNECT_0_NAME: kafka-connect
KAFKA_CLUSTERS_0_KAFKACONNECT_0_ADDRESS: http://kafka-connect:8083
AUTH_TYPE: "LOGIN_FORM"
SPRING_SECURITY_USER_NAME: admin
SPRING_SECURITY_USER_PASSWORD: admin
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "10"
postgres:
image: postgres:16.0-alpine3.18
container_name: postgres-database
restart: always
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
command:
- "postgres"
- "-c"
- "shared_preload_libraries=pgoutput"
- "-c"
- "wal_level=logical"
ports:
- '127.0.0.1:5432:5432'
volumes:
- ./test_data_postgres/init.sql:/docker-entrypoint-initdb.d/init.sql
- ./postgres_data:/var/lib/postgresql/data
depends_on:
- zookeeper
- kafka-broker-1
- schema-registry
- kafka-rest
- kafka-connect
- kafka-ui
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "10"