-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathdocker-compose.yml
179 lines (168 loc) · 4.52 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
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
version: '3.8'
services:
# PostgreSQL - Source Database
postgres:
image: postgres:15
environment:
POSTGRES_DB: cars_db
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres123
command: ["postgres", "-c", "wal_level=logical"]
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./postgres/init.sql:/docker-entrypoint-initdb.d/init.sql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
# Zookeeper
zookeeper:
image: confluentinc/cp-zookeeper:7.4.0
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
ports:
- "2181:2181"
healthcheck:
test: echo srvr | nc zookeeper 2181 || exit 1
interval: 10s
timeout: 5s
retries: 5
# Kafka
kafka:
image: confluentinc/cp-kafka:7.4.0
depends_on:
zookeeper:
condition: service_healthy
ports:
- "9092:9092"
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:29092,PLAINTEXT_HOST://localhost:9092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
healthcheck:
test: ["CMD-SHELL", "kafka-topics --bootstrap-server localhost:9092 --list"]
interval: 30s
timeout: 10s
retries: 3
# Debezium Connect
connect:
image: debezium/connect:2.4
depends_on:
kafka:
condition: service_healthy
postgres:
condition: service_healthy
ports:
- "8083:8083"
environment:
BOOTSTRAP_SERVERS: kafka:29092
GROUP_ID: "1"
CONFIG_STORAGE_TOPIC: connect_configs
OFFSET_STORAGE_TOPIC: connect_offsets
STATUS_STORAGE_TOPIC: connect_statuses
KEY_CONVERTER: org.apache.kafka.connect.json.JsonConverter
VALUE_CONVERTER: org.apache.kafka.connect.json.JsonConverter
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8083/"]
interval: 30s
timeout: 10s
retries: 3
# MinIO (S3-compatible storage)
minio:
image: minio/minio
ports:
- "9000:9000"
- "9001:9001"
environment:
MINIO_ROOT_USER: minio
MINIO_ROOT_PASSWORD: minio123
command: server /data --console-address ":9001"
volumes:
- minio_data:/data
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 30s
timeout: 20s
retries: 3
# MLflow
mlflow:
build:
context: ./mlflow
dockerfile: Dockerfile
ports:
- "5000:5000"
environment:
MLFLOW_S3_ENDPOINT_URL: http://minio:9000
AWS_ACCESS_KEY_ID: minio
AWS_SECRET_ACCESS_KEY: minio123
depends_on:
minio:
condition: service_healthy
postgres:
condition: service_healthy
healthcheck:
test: curl --fail http://localhost:5000/health || exit 1
interval: 30s
timeout: 10s
retries: 5
start_period: 30s
command: |
sh -c '
mc config host add minio http://minio:9000 minio minio123 &&
mc mb minio/mlflow || true &&
mlflow server \
--backend-store-uri postgresql://postgres:postgres123@postgres:5432/mlflow \
--default-artifact-root s3://mlflow/ \
--host 0.0.0.0 \
--port 5000 \
--serve-artifacts
'
# Redpanda Console (Kafka Web UI)
kafka-ui:
image: redpandadata/console:v2.4.3
ports:
- "8080:8080"
depends_on:
kafka:
condition: service_healthy
environment:
KAFKA_BROKERS: kafka:29092
SERVER_LISTENPORT: 8080
AUTH_PROVIDER: none
CONNECT_ENABLED: "true"
CONNECT_CLUSTERS_NAME: "kafka-connect"
CONNECT_CLUSTERS_URL: "http://connect:8083"
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8080"]
interval: 30s
timeout: 10s
retries: 5
start_period: 30s
# Adminer Console (Postgres Web UI)
adminer:
image: adminer:latest
ports:
- "8081:8080"
depends_on:
postgres:
condition: service_healthy
environment:
ADMINER_DEFAULT_SERVER: postgres
ADMINER_DESIGN: pepa-linha
ADMINER_DEFAULT_DB: cars_db
ADMINER_DEFAULT_USER: postgres
ADMINER_DEFAULT_PASSWORD: postgres123
restart: always
volumes:
postgres_data:
minio_data:
networks:
default:
driver: bridge