Skip to content

Instantly share code, notes, and snippets.

@ih0r-d
Created September 27, 2019 07:44
Show Gist options
  • Select an option

  • Save ih0r-d/700b852feef5e931d7d7ca2c85fd794b to your computer and use it in GitHub Desktop.

Select an option

Save ih0r-d/700b852feef5e931d7d7ca2c85fd794b to your computer and use it in GitHub Desktop.
Basic docker compose for start kafka with zookeeper
version: '3.7'
services:
zookeeper:
image: wurstmeister/zookeeper
container_name: zookeeper-service
ports:
- "2181:2181"
hostname: zookeeper
kafka:
image: wurstmeister/kafka
container_name: kafka-service
ports:
- "9092:9092"
hostname: kafka-service
environment:
KAFKA_CREATE_TOPICS: "get_file:1:1, track_messages:1:1" #topic:partitions:replicas
KAFKA_ADVERTISED_HOST_NAME: kafka-service
KAFKA_ZOOKEEPER_CONNECT: zookeeper-service:2181
KAFKA_ADVERTISED_PORT: 9092
volumes:
- /var/run/docker.sock:/var/run/docker.sock
depends_on:
- zookeeper
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment