Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
160 lines (150 loc) · 4.12 KB
/
Copy pathdocker-compose.yml
File metadata and controls
160 lines (150 loc) · 4.12 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
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
name: cdc-cache
networks:
cdc:
driver: bridge
volumes:
postgres-data:
redis-data:
debezium-data:
services:
postgres:
image: postgres:16
networks: [cdc]
ports: ["5432:5432"]
environment:
POSTGRES_USER: ${POSTGRES_USER:-cdc}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-cdc}
POSTGRES_DB: ${POSTGRES_DB:-tpch}
command:
- postgres
- -c
- wal_level=logical
- -c
- max_replication_slots=4
- -c
- max_wal_senders=4
- -c
- max_slot_wal_keep_size=4GB
- -c
- shared_buffers=2GB
- -c
- effective_cache_size=8GB
volumes:
- postgres-data:/var/lib/postgresql/data
- ./postgres/init.sql:/docker-entrypoint-initdb.d/00-init.sql:ro
- ./postgres/tpch_schema.sql:/docker-entrypoint-initdb.d/01-tpch_schema.sql:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-cdc} -d ${POSTGRES_DB:-tpch}"]
interval: 5s
timeout: 5s
retries: 10
start_period: 10s
kafka:
image: apache/kafka:3.7.0
networks: [cdc]
ports: ["9092:9092", "29092:29092"]
environment:
KAFKA_PROCESS_ROLES: broker,controller
KAFKA_NODE_ID: 1
KAFKA_LISTENERS: PLAINTEXT://:9092,HOST://:29092,CONTROLLER://:9093
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092,HOST://localhost:29092
KAFKA_CONTROLLER_LISTENER_NAMES: CONTROLLER
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,HOST:PLAINTEXT,CONTROLLER:PLAINTEXT
KAFKA_CONTROLLER_QUORUM_VOTERS: 1@kafka:9093
CLUSTER_ID: ${CLUSTER_ID:-MkU3OEVBNTcwNTJENDM2Qk}
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
healthcheck:
test: ["CMD-SHELL", "/opt/kafka/bin/kafka-topics.sh --bootstrap-server localhost:9092 --list"]
interval: 10s
timeout: 10s
retries: 10
start_period: 15s
debezium:
image: debezium/server:2.6
networks: [cdc]
depends_on:
kafka:
condition: service_healthy
postgres:
condition: service_healthy
volumes:
- debezium-data:/debezium/data
- ./debezium/application.properties:/debezium/conf/application.properties:ro
restart: "no"
trino:
image: trinodb/trino:450
networks: [cdc]
ports: ["8080:8080"]
deploy:
resources:
limits:
memory: 5g
volumes:
- ./trino/config.properties:/etc/trino/config.properties:ro
- ./trino/jvm.config:/etc/trino/jvm.config:ro
- ./trino/catalog/postgres.properties:/etc/trino/catalog/postgres.properties:ro
healthcheck:
test: ["CMD-SHELL", "curl -sf http://localhost:8080/v1/info | grep -q '\"starting\":false'"]
interval: 10s
timeout: 10s
retries: 20
start_period: 30s
redis:
image: redis:7
networks: [cdc]
ports: ["6379:6379"]
command: >
redis-server
--maxmemory 4gb
--maxmemory-policy noeviction
--appendonly yes
--appendfsync everysec
--save ""
volumes:
- redis-data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 10
proxy:
build: ./proxy
networks: [cdc]
ports: ["8081:8081"]
environment:
REDIS_ADDR: redis:6379
TRINO_URL: http://trino:8080
TRINO_CATALOG: postgres
TRINO_SCHEMA: public
depends_on:
redis:
condition: service_healthy
trino:
condition: service_healthy
bridge:
build: ./bridge
networks: [cdc]
environment:
KAFKA_BOOTSTRAP: kafka:9092
REDIS_ADDR: redis:6379
depends_on:
kafka:
condition: service_healthy
redis:
condition: service_healthy
restart: on-failure
shadow:
build: ./shadow
networks: [cdc]
environment:
REDIS_ADDR: redis:6379
POSTGRES_DSN: postgres://cdc:cdc@postgres:5432/tpch?sslmode=disable&options=-c%20DateStyle%3DISO%2CMDY
SHADOW_SAMPLE_RATE: "1.0"
depends_on:
redis:
condition: service_healthy
postgres:
condition: service_healthy
restart: on-failure