forked from kaufland-ecommerce/esque
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
51 lines (45 loc) · 1.69 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
# Based on https://github.com/confluentinc/cp-docker-images/blob/master/examples/cp-all-in-one/docker-compose.yml
version: '3'
services:
zookeeper:
image: confluentinc/cp-zookeeper:5.1.3
hostname: zookeeper
container_name: zookeeper
ports:
- 2181:2181
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
kafka:
image: confluentinc/cp-kafka:5.1.3
hostname: kafka
container_name: kafka
depends_on:
- zookeeper
ports:
- 9093:9093
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: 'zookeeper:2181'
# We need zookeeper to advertise two different urls since the broker has to be reachable
# from two different environments (once from inside the docker network and once from the host)
# However it is neither possible to advertise two listeners but only configure one via KAFKA_LISTENERS
# nor is it possible to advertise two listeners with the same protocol but different ports and hostnames since
# they are still considered to have the same name.
# We can do nothing about the former case but we can trick kafka with a custom protocol in the latter case.
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: 'PLAINTEXT:PLAINTEXT,FOO:PLAINTEXT'
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092,FOO://localhost:9093
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
esque:
build: .
volumes:
- .:/esque
environment:
ESQUE_TEST_ENV: "ci"
depends_on:
- kafka
command: >
-c
"(until (kafkacat -b kafka:9092 -X debug=all -L); do sleep 5s; done) \
&& pytest tests/ --integration"