-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
123 lines (106 loc) · 3.48 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
services:
kafka-kraft:
image: apache/kafka:3.7.0
ports:
- "9092:9092"
environment:
KAFKA_NODE_ID: 1
CLUSTER_ID: 'cluster-12345'
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: 'CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT'
KAFKA_ADVERTISED_LISTENERS: 'PLAINTEXT://kafka-kraft:29092,PLAINTEXT_HOST://kafka-kraft:9092'
KAFKA_PROCESS_ROLES: 'broker,controller'
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_CONTROLLER_QUORUM_VOTERS: '1@kafka-kraft:29093'
KAFKA_LISTENERS: 'PLAINTEXT://kafka-kraft:29092,CONTROLLER://kafka-kraft:29093,PLAINTEXT_HOST://kafka-kraft:9092'
KAFKA_INTER_BROKER_LISTENER_NAME: 'PLAINTEXT'
KAFKA_CONTROLLER_LISTENER_NAMES: 'CONTROLLER'
KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'true'
healthcheck:
test: ["CMD", "sh", "-c", "/opt/kafka/bin/kafka-broker-api-versions.sh --bootstrap-server kafka-kraft:29092 | grep 'id:'"]
interval: 5s
timeout: 10s
retries: 5
kafka-init:
image: nicolaka/netshoot:v0.13
command: ["sh", "-c", "while ! nc -z kafka-kraft 29092; do sleep 1; done;"]
init: true
depends_on:
kafka-kraft:
condition: service_healthy
postgres:
image: postgres:13
environment:
POSTGRES_USER: kafka_user
POSTGRES_PASSWORD: 123456
POSTGRES_DB: demo_sink
volumes:
- ./vol-postgres/:/docker-entrypoint-initdb.d
ports:
- "5432:5432"
depends_on:
kafka-init:
condition: service_completed_successfully
kafka-rest-proxy:
image: confluentinc/cp-kafka-rest:7.6.1
ports:
- "8082:8082"
environment:
KAFKA_REST_BOOTSTRAP_SERVERS: "kafka-kraft:29092"
depends_on:
kafka-init:
condition: service_completed_successfully
kafdrop:
image: obsidiandynamics/kafdrop:4.0.1
ports:
- "9020:9000"
environment:
KAFKA_BROKERCONNECT: kafka-kraft:29092
depends_on:
kafka-init:
condition: service_completed_successfully
prometheus:
image: prom/prometheus:v2.52.0
ports:
- "9090:9090"
volumes:
- ./vol-prometheus/custom-prometheus.yml:/etc/prometheus/custom-prometheus.yml
command:
- '--config.file=/etc/prometheus/custom-prometheus.yml'
depends_on:
kafka-init:
condition: service_completed_successfully
kafka-connect:
build:
context: ./
dockerfile: Dockerfile
ports:
- "8083:8083"
environment:
KAFKA_CONNECT_BOOTSTRAP_SERVERS: "kafka-kraft:29092"
KAFKA_CONNECT_PROPERTIES_PATH: "/config/custom-connect-standalone.properties"
JMX_EXPORTER_CONFIG_PATH: "/config/custom-connect-jmx-exporter.yaml"
KAFKA_CONNECT_KEY_CONVERTER: "org.apache.kafka.connect.storage.StringConverter"
KAFKA_CONNECT_VALUE_CONVERTER: "org.apache.kafka.connect.storage.StringConverter"
volumes:
- ./vol-kafka-connect/custom-config/:/config/
- ./vol-kafka-connect/connectors/:/opt/connectors/
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8083/connectors"]
interval: 5s
timeout: 10s
retries: 5
depends_on:
kafka-init:
condition: service_completed_successfully
tests:
image: nicolaka/netshoot:v0.13
command: ["sh", "-c", "while ! nc -z kafka-connect 8083; do sleep 1; done; /tests/run-tests.sh"]
volumes:
- ./vol-tests/:/tests/
init: true
depends_on:
kafka-connect:
condition: service_healthy
networks:
default:
name: kafka-connect-network