Repository navigation
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
103 lines (96 loc) · 2.87 KB
/
Copy pathdocker-compose.yaml
File metadata and controls
103 lines (96 loc) · 2.87 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
version: '3'
services:
zookeeper:
image: confluentinc/cp-zookeeper:7.9.2
networks:
- broker-kafka
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
kafka:
image: confluentinc/cp-kafka:7.9.2
networks:
- broker-kafka
depends_on:
- zookeeper
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
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
kafka-ui:
image: provectuslabs/kafka-ui:latest
networks:
- broker-kafka
depends_on:
- kafka
ports:
- 9090:8080
environment:
KAFKA_CLUSTERS_0_NAME: local
KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: kafka:29092
KAFKA_CLUSTERS_0_ZOOKEEPER: zookeeper:2181
postgres:
image: postgres:18.6
networks:
- broker-kafka
ports:
- 5436:5432
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
POSTGRES_DB: contract
mongodb:
# Pinned because later MongoDB 8.0 images reject Docker Desktop's LinuxKit 7.0.12 kernel
# (SERVER-121912). Upgrade to the cluster's patch when Docker Desktop provides kernel 7.0.14+.
image: mongo:8.0.4
# Command required to have transactions work locally
command: ["--replSet", "rs0", "--bind_ip_all"]
healthcheck:
test: mongosh --quiet --eval "try { rs.status().ok } catch (e) { rs.initiate({_id:'rs0',members:[{_id:0,host:'localhost:27017'}]}).ok }"
interval: 5s
timeout: 10s
retries: 10
networks:
- broker-kafka
ports:
- 27019:27017
deploy:
resources:
limits:
cpus: '1'
memory: 2g
toxiproxy:
image: ghcr.io/shopify/toxiproxy:2.12.0
networks:
- broker-kafka
depends_on:
- mongodb
ports:
- 8474:8474
- 27017:27018
- 27018:27018
toxiproxy-init:
image: curlimages/curl:8.22.0
networks:
- broker-kafka
depends_on:
- toxiproxy
restart: "no"
entrypoint:
- sh
- -c
- |
until curl -sf http://toxiproxy:8474/version; do echo "waiting for toxiproxy"; sleep 0.5; done
curl -sf http://toxiproxy:8474/populate -d '[{"name":"mongo","listen":"0.0.0.0:27018","upstream":"mongodb:27017","enabled":true}]'
curl -sf -X DELETE http://toxiproxy:8474/proxies/mongo/toxics/mongo_latency || true
curl -sf http://toxiproxy:8474/proxies/mongo/toxics -d '{"name":"mongo_latency","type":"latency","attributes":{"latency":12,"jitter":2}}'
networks:
broker-kafka:
driver: bridge