-
Notifications
You must be signed in to change notification settings - Fork 5
/
docker-compose.yml
53 lines (48 loc) · 1.32 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
version: '2.2'
services:
postgres-db:
image: postgres:latest
ports:
- 5432:5432
environment:
POSTGRES_USER: shopping-cart
POSTGRES_PASSWORD: shopping-cart
# this second PostgresSQL is used when running test
postgres-db-test:
image: postgres:latest
ports:
- 5433:5432
environment:
POSTGRES_DB: shopping-cart
POSTGRES_USER: shopping-cart
POSTGRES_PASSWORD: shopping-cart
# See dockerhub for different versions of kafka and zookeeper
# https://hub.docker.com/r/wurstmeister/kafka/
# https://hub.docker.com/r/wurstmeister/zookeeper/
zookeeper:
image: zookeeper:3.6.2
ports:
- "2181:2181"
kafka:
image: wurstmeister/kafka:2.13-2.7.0
ports:
- "9092:9092"
environment:
KAFKA_ADVERTISED_HOST_NAME: localhost
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
kafka-consumer:
image: wurstmeister/kafka:2.13-2.7.0
command: bash -c "mkdir -vp /tmp/kafka-logs && /opt/kafka_2.13-2.7.0/bin/kafk-console-consumer.sh --zookeeper zookeeper:2181 --from-beginning --topic-name > /tmp/kafka-logs/topic-name.log"
ports:
- "9094:9092"
links:
- zookeeper
- kafka
volumes:
- ./kafka-1-logs:/tmp/kafka-logs
wait-for-kafka:
image: waisbrot/wait
links:
- kafka
environment:
- TARGETS=kafka:9092