Skip to content

Instantly share code, notes, and snippets.

@erikvullings
Created September 13, 2017 10:16
Show Gist options
  • Save erikvullings/b6363444fb232477ef381b1bb7dcbb32 to your computer and use it in GitHub Desktop.
Save erikvullings/b6363444fb232477ef381b1bb7dcbb32 to your computer and use it in GitHub Desktop.
Docker-compose file for Kafka
---
version: '2'
services:
zookeeper:
image: confluentinc/cp-zookeeper
hostname: zookeeper
extra_hosts:
- "moby:127.0.0.1"
ports:
- "2181:2181"
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
broker:
image: confluentinc/cp-kafka
hostname: broker
extra_hosts:
- "moby:127.0.0.1"
depends_on:
- zookeeper
ports:
- '9092:9092'
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: 'zookeeper:2181'
KAFKA_ADVERTISED_LISTENERS: 'PLAINTEXT://broker:9092'
KAFKA_DEFAULT_REPLICATION_FACTOR: 1
KAFKA_MESSAGE_MAX_BYTES: 100000000
KAFKA_REPLICA_FETCH_MAX_BYTES: 100000000
schema_registry:
image: confluentinc/cp-schema-registry
hostname: schema_registry
# extra_hosts:
# - "moby:127.0.0.1"
depends_on:
- zookeeper
- broker
ports:
- '8081:8081'
environment:
SCHEMA_REGISTRY_HOST_NAME: schema_registry
SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL: 'zookeeper:2181'
kafka-rest:
image: confluentinc/cp-kafka-rest
container_name: kafka-rest
extra_hosts:
- "moby:127.0.0.1"
depends_on:
- zookeeper
- broker
ports:
- '8082:8082'
environment:
KAFKA_REST_ZOOKEEPER_CONNECT: 'zookeeper:2181'
KAFKA_REST_LISTENERS: http://kafka-rest:8082
KAFKA_REST_SCHEMA_REGISTRY_URL: http://schema-registry:8081
KAFKA_REST_HOST_NAME: kafka-rest
# kafka-manager:
# image: sheepkiller/kafka-manager
# depends_on:
# - zookeeper
# ports:
# - '9000:9000'
# links:
# - zookeeper
# environment:
# - ZK_HOSTS=zookeeper:2181
# - APPLICATION_SECRET=letmein
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment