-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathdocker-compose.contract.yml
More file actions
63 lines (61 loc) · 2.33 KB
/
Copy pathdocker-compose.contract.yml
File metadata and controls
63 lines (61 loc) · 2.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
# Self-contained brokers for the broker contract suite (EVO-1199).
#
# Unlike docker/docker-compose.{kafka,rabbitmq}.yml (which require the external
# `local-net` network and ship dev-only extras like kafka-ui), this compose is
# standalone: a plain bridge network + healthchecks so CI and the local suite
# can `up -d`, wait for healthy, and run without touching the dev stack.
#
# docker compose -f docker-compose.contract.yml up -d
# BROKER_CONTRACT=1 \
# KAFKA_BROKERS=localhost:9092 \
# RABBITMQ_URL=amqp://admin:admin@localhost:5672 \
# npm test -- broker.contract.spec
services:
zookeeper:
image: confluentinc/cp-zookeeper:7.5.0
container_name: evo-campaign-zookeeper
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
kafka:
image: confluentinc/cp-kafka:7.5.0
container_name: evo-campaign-kafka
# Gate readiness on Kafka's own healthcheck (it only passes once the broker
# — and therefore Zookeeper — is fully up). Zookeeper has no healthcheck of
# its own because cp-zookeeper does not whitelist the `ruok` 4lw command, so
# `echo ruok | nc` reports unhealthy and would wedge `up --wait`.
depends_on:
zookeeper:
condition: service_started
ports:
- "9092:9092"
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: 'zookeeper:2181'
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:29092,PLAINTEXT_HOST://localhost:9092
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'false'
healthcheck:
test: ["CMD", "kafka-broker-api-versions", "--bootstrap-server", "localhost:9092"]
interval: 10s
timeout: 10s
retries: 20
rabbitmq:
image: rabbitmq:3.12-management-alpine
container_name: evo-campaign-rabbitmq
ports:
- "5672:5672"
- "15672:15672"
environment:
RABBITMQ_DEFAULT_USER: admin
RABBITMQ_DEFAULT_PASS: admin
healthcheck:
test: ["CMD", "rabbitmq-diagnostics", "-q", "ping"]
interval: 10s
timeout: 10s
retries: 20