docker-compose-files/kafka/docker-compose.yaml

36 lines
889 B
YAML
Raw Normal View History

2017-09-15 13:31:23 +08:00
# The minimal kafka service
# github.com/yeasy/docker-compose-files
# * zk: zk node for kafka
# * kafka: kafka service, will default to connect to zookeeper
# * cli: client to test kafka service
version: '2'
services:
zookeeper:
2017-09-15 13:39:12 +08:00
image: yeasy/kafka:0.11.0.1
2017-09-15 13:31:23 +08:00
container_name: zookeeper
hostname: zookeeper
ports:
- "2181:2181" # zk connection port
command: bash -c 'bash /tmp/start_zk.sh'
kafka: # kafka service
2017-09-15 13:39:12 +08:00
image: yeasy/kafka:0.11.0.1
2017-09-15 13:31:23 +08:00
container_name: kafka
hostname: kafka
ports:
- "9092:9092"
depends_on:
- zookeeper
command: bash -c 'bash /tmp/start_kafka.sh'
cli: # used for testing kafka cmds, see /tmp/*.sh
2017-09-15 13:39:12 +08:00
image: yeasy/kafka:0.11.0.1
2017-09-15 13:31:23 +08:00
container_name: cli
hostname: cli
environment:
- ZK_HOST=zookeeper # zk host to connect to
command: bash -c 'while true; do sleep 20170915; done'