Created
October 7, 2020 16:42
-
-
Save dcode/a79d24624aee11ca713250cc5ba02a22 to your computer and use it in GitHub Desktop.
Docker compose to standup a local minimal Kafka cluster, useful for development purposes. Can connect from host on port 9093/tcp.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '2' | |
services: | |
zookeeper: | |
image: 'docker.io/bitnami/zookeeper:3-debian-10' | |
ports: | |
- '2181:2181' | |
networks: | |
- 'data-tier' | |
volumes: | |
- 'zookeeper_data:/bitnami' | |
environment: | |
- ALLOW_ANONYMOUS_LOGIN=yes | |
kafka: | |
image: 'docker.io/bitnami/kafka:2-debian-10' | |
ports: | |
- '9092:9092' | |
- '9093:9093' | |
volumes: | |
- 'kafka_data:/bitnami' | |
networks: | |
- 'data-tier' | |
environment: | |
- KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper:2181 | |
- ALLOW_PLAINTEXT_LISTENER=yes | |
- KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=CLIENT:PLAINTEXT,EXTERNAL:PLAINTEXT | |
- KAFKA_CFG_LISTENERS=CLIENT://:9092,EXTERNAL://:9093 | |
- KAFKA_CFG_ADVERTISED_LISTENERS=CLIENT://kafka:9092,EXTERNAL://localhost:9093 | |
- KAFKA_INTER_BROKER_LISTENER_NAME=CLIENT | |
depends_on: | |
- zookeeper | |
volumes: | |
zookeeper_data: | |
driver: local | |
kafka_data: | |
driver: local | |
networks: | |
data-tier: | |
driver: bridge |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment