-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
195 lines (182 loc) · 5.06 KB
/
Copy pathdocker-compose.yaml
File metadata and controls
195 lines (182 loc) · 5.06 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
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
services:
# --- Infrastructure ---
postgres-source:
image: postgres:17
hostname: postgres-source
ports:
- "127.0.0.1:5433:5432"
environment:
POSTGRES_USER: ducklake
POSTGRES_PASSWORD: ducklake
POSTGRES_DB: ducklake
healthcheck:
test: pg_isready -U ducklake -d ducklake
interval: 2s
timeout: 5s
retries: 5
tmpfs:
- /var/lib/postgresql/data
postgres-dest-1:
image: postgres:17
hostname: postgres-dest-1
environment:
POSTGRES_USER: ducklake
POSTGRES_PASSWORD: ducklake
POSTGRES_DB: ducklake
healthcheck:
test: pg_isready -U ducklake -d ducklake
interval: 2s
timeout: 5s
retries: 5
tmpfs:
- /var/lib/postgresql/data
postgres-dest-2:
image: postgres:17
hostname: postgres-dest-2
environment:
POSTGRES_USER: ducklake
POSTGRES_PASSWORD: ducklake
POSTGRES_DB: ducklake
healthcheck:
test: pg_isready -U ducklake -d ducklake
interval: 2s
timeout: 5s
retries: 5
tmpfs:
- /var/lib/postgresql/data
minio:
image: minio/minio:latest
hostname: minio
ports:
- "127.0.0.1:9000:9000"
- "127.0.0.1:9001:9001"
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
MINIO_PROMETHEUS_AUTH_TYPE: public
command: server /data --console-address ":9001"
healthcheck:
test: mc ready local
interval: 2s
timeout: 5s
retries: 5
minio-init:
image: minio/mc:latest
depends_on:
minio:
condition: service_healthy
entrypoint: >
/bin/sh -c "
mc alias set local http://minio:9000 minioadmin minioadmin &&
mc mb --ignore-existing local/source &&
mc mb --ignore-existing local/dest-1 &&
mc mb --ignore-existing local/dest-2
"
# --- Producer: writes sample events to source DuckLake ---
producer:
build:
context: .
dockerfile: Dockerfile
args:
VIADUCK_VERSION: "0.0.0.dev0"
depends_on:
postgres-source:
condition: service_healthy
minio-init:
condition: service_completed_successfully
entrypoint: python
command: /app/test/producer.py
environment:
SOURCE_POSTGRES_URI: "postgres:host=postgres-source port=5432 user=ducklake password=ducklake dbname=ducklake"
S3_ENDPOINT: minio:9000
S3_ACCESS_KEY_ID: minioadmin
S3_SECRET_ACCESS_KEY: minioadmin
S3_USE_SSL: "false"
S3_URL_STYLE: path
S3_DATA_PATH: s3://source/
BATCH_SIZE: "5"
BATCH_INTERVAL: "2"
healthcheck:
test: ["CMD-SHELL", "true"]
interval: 10s
volumes:
- ./test:/app/test:ro
# --- Viaduck: CDC replication ---
viaduck:
build:
context: .
dockerfile: Dockerfile
args:
VIADUCK_VERSION: "0.0.0.dev0"
depends_on:
producer:
condition: service_started
postgres-dest-1:
condition: service_healthy
postgres-dest-2:
condition: service_healthy
ports:
- "127.0.0.1:8000:8000"
command: ["--config", "/app/test/viaduck-dev.yaml"]
environment:
SOURCE_POSTGRES_URI: "postgres:host=postgres-source port=5432 user=ducklake password=ducklake dbname=ducklake"
DEST_1_POSTGRES_URI: "postgres:host=postgres-dest-1 port=5432 user=ducklake password=ducklake dbname=ducklake"
DEST_2_POSTGRES_URI: "postgres:host=postgres-dest-2 port=5432 user=ducklake password=ducklake dbname=ducklake"
S3_ACCESS_KEY_ID: minioadmin
S3_SECRET_ACCESS_KEY: minioadmin
volumes:
- ./test:/app/test:ro
# --- Metrics & Dashboarding ---
prometheus:
image: prom/prometheus:latest
ports:
- "127.0.0.1:9091:9090"
configs:
- source: prometheus-config
target: /etc/prometheus/prometheus.yml
grafana:
image: grafana/grafana-oss:latest
ports:
- "127.0.0.1:3000:3000"
environment:
GF_AUTH_ANONYMOUS_ENABLED: "true"
GF_AUTH_ANONYMOUS_ORG_ROLE: Admin
GF_AUTH_DISABLE_LOGIN_FORM: "true"
volumes:
- ./grafana/dashboards:/var/lib/grafana/dashboards:ro
configs:
- source: grafana-datasource
target: /etc/grafana/provisioning/datasources/prometheus.yaml
- source: grafana-dashboard-provider
target: /etc/grafana/provisioning/dashboards/viaduck.yaml
configs:
grafana-datasource:
content: |
apiVersion: 1
datasources:
- name: Prometheus
type: prometheus
access: proxy
url: http://prometheus:9090
isDefault: true
grafana-dashboard-provider:
content: |
apiVersion: 1
providers:
- name: viaduck
type: file
options:
path: /var/lib/grafana/dashboards
prometheus-config:
content: |
global:
scrape_interval: 5s
scrape_configs:
- job_name: viaduck
static_configs:
- targets:
- viaduck:8000
- job_name: minio
metrics_path: /minio/v2/metrics/cluster
static_configs:
- targets: ["minio:9000"]