Skip to content

Instantly share code, notes, and snippets.

@hackintoshrao
Created March 5, 2018 08:25
Show Gist options
  • Save hackintoshrao/ecae258c37ff87ad8b779d898afd6bdb to your computer and use it in GitHub Desktop.
Save hackintoshrao/ecae258c37ff87ad8b779d898afd6bdb to your computer and use it in GitHub Desktop.
Docker compose configuration for runnig cofluent kafka and exposing the services to localhost
---
version: '2'
services:
zookeeper:
image: confluentinc/cp-zookeeper:3.2.1
ports:
- 32181:32181
environment:
ZOOKEEPER_CLIENT_PORT: 32181
ZOOKEEPER_TICK_TIME: 2000
extra_hosts:
- "moby:127.0.0.1"
- "localhost: 127.0.0.1"
kafka:
image: confluentinc/cp-kafka:3.2.1
ports:
- 29092:29092
depends_on:
- zookeeper
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:32181
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:29092
KAFKA_AUTO_CREATE_TOPICS_ENABLE: "false"
KAFKA_DELETE_TOPIC_ENABLE: "true"
extra_hosts:
- "moby:127.0.0.1"
- "localhost: 127.0.0.1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment