-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
97 lines (93 loc) · 3.33 KB
/
docker-compose.yml
File metadata and controls
97 lines (93 loc) · 3.33 KB
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
services:
zookeeper:
image: wurstmeister/zookeeper
container_name: zookeeper
ports:
- "2181:2181"
volumes:
- zookeeper-data:/data
kafka:
image: wurstmeister/kafka
container_name: kafka
ports:
- "9092:9092"
- "9093:9093"
environment:
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_LISTENERS: PLAINTEXT_INTERNAL://0.0.0.0:9092,PLAINTEXT_EXTERNAL://0.0.0.0:9093
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT_INTERNAL://kafka:9092,PLAINTEXT_EXTERNAL://localhost:9093
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT_INTERNAL:PLAINTEXT,PLAINTEXT_EXTERNAL:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT_INTERNAL
depends_on:
- zookeeper
volumes:
- kafka-data:/kafka
kafka-connect:
image: quay.io/debezium/connect:3.0
container_name: kafka-connect
ports:
- "8085:8083"
environment:
BOOTSTRAP_SERVERS: kafka:9092
GROUP_ID: 1
CONFIG_STORAGE_TOPIC: debezium-configs
CONFIG_STORAGE_REPLICATION_FACTOR: 1
OFFSET_STORAGE_TOPIC: debezium-offsets
OFFSET_STORAGE_REPLICATION_FACTOR: 1
STATUS_STORAGE_TOPIC: debezium-status
STATUS_STORAGE_REPLICATION_FACTOR: 1
depends_on:
- kafka
healthcheck:
test: ["CMD", "curl", "-sf", "http://localhost:8083/health"]
interval: 10s
timeout: 5s
retries: 10
start_period: 30s
kafka-connect-init:
image: curlimages/curl
container_name: kafka-connect-init
depends_on:
kafka-connect:
condition: service_healthy
restart: on-failure
entrypoint:
- sh
- -c
- |
until curl -sf http://kafka-connect:8083/health; do
sleep 3
done
curl -sf -o /dev/null -X PUT http://kafka-connect:8083/connectors/volunteer-mysql-connector/config \
-H 'Content-Type: application/json' \
-d '{
"connector.class": "io.debezium.connector.mysql.MySqlConnector",
"database.hostname": "host.docker.internal",
"database.port": "3306",
"database.user": "debezium",
"database.password": "debezium1234",
"database.server.id": "1",
"topic.prefix": "volunteer",
"database.include.list": "finda_volunteer",
"schema.history.internal.kafka.bootstrap.servers": "kafka:9092",
"schema.history.internal.kafka.topic": "schema-changes.volunteer",
"database.connectionTimeZone": "Asia/Seoul"
}' || exit 1
curl -sf -o /dev/null -X PUT http://kafka-connect:8083/connectors/notification-mysql-connector/config \
-H 'Content-Type: application/json' \
-d '{
"connector.class": "io.debezium.connector.mysql.MySqlConnector",
"database.hostname": "host.docker.internal",
"database.port": "3306",
"database.user": "debezium",
"database.password": "debezium1234",
"database.server.id": "2",
"topic.prefix": "notification",
"database.include.list": "finda_notification",
"schema.history.internal.kafka.bootstrap.servers": "kafka:9092",
"schema.history.internal.kafka.topic": "schema-changes.notification",
"database.connectionTimeZone": "Asia/Seoul"
}' || exit 1
volumes:
zookeeper-data:
kafka-data: