Created
October 27, 2019 18:41
-
-
Save saabeilin/234e4b295367a63ea63fef39fcf6a263 to your computer and use it in GitHub Desktop.
Apache Kafka - Docker Compose File Dev Environment single broker
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: '3.5' | |
services: | |
ws-zookeeper-1: | |
image: confluentinc/cp-zookeeper:5.3.1 | |
hostname: ws-zookeeper-1 | |
container_name: ws-zookeeper-1 | |
ports: | |
- "127.0.0.1:22181:2181" | |
environment: | |
ZOOKEEPER_SERVER_ID: 1 | |
ZOOKEEPER_SERVERS: "ws-zookeeper-1:4182:5181" | |
ZOOKEEPER_CLIENT_PORT: 2181 | |
ZOOKEEPER_TICK_TIME: 2000 | |
ZOOKEEPER_AUTOPURGE_SNAP_RETAIN_COUNT: 3 | |
ZOOKEEPER_PURGE_INTERVAL: 24 | |
CONFIG_ZOOKEEPER_INIT_LIMIT: 10 | |
CONFIG_ZOOKEEPER_SYNC_LIMIT: 5 | |
healthcheck: | |
test: /bin/sh -c '[ \"imok\" = \"$$(echo ruok | nc -w 1 127.0.0.1 2181)\" ]' || exit 1 | |
interval: 1m | |
volumes: | |
- ws-zookeeper-1-data:/var/lib/zookeeper/data/ | |
- ws-zookeeper-1-log:/var/lib/zookeeper/log/ | |
ws-kafka-1: | |
image: confluentinc/cp-kafka:5.3.1 | |
hostname: ws-kafka-1 | |
container_name: ws-kafka-1 | |
stop_grace_period: 5m | |
depends_on: | |
- ws-zookeeper-1 | |
ports: | |
- "127.0.0.1:29092:29092" | |
environment: | |
KAFKA_BROKER_ID: 1 | |
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: "PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT" | |
KAFKA_ADVERTISED_LISTENERS: "PLAINTEXT://ws-kafka-1:9092,PLAINTEXT_HOST://localhost:29092" | |
KAFKA_AUTO_CREATE_TOPICS_ENABLE: "true" | |
KAFKA_DELETE_TOPIC_ENABLE: "true" | |
KAFKA_NUM_PARTITIONS: 8 | |
KAFKA_ZOOKEEPER_CONNECT: "ws-zookeeper-1:2181" | |
KAFKA_DEFAULT_REPLICATION_FACTOR: 1 | |
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 | |
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1 | |
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1 | |
KAFKA_MIN_INSYNC_REPLICAS: 1 | |
volumes: | |
- ws-kafka-1-data:/var/lib/kafka/data/ | |
ws-schema-registry: | |
image: confluentinc/cp-schema-registry:5.3.1 | |
hostname: ws-schema-registry | |
container_name: ws-schema-registry | |
depends_on: | |
- ws-zookeeper-1 | |
- ws-kafka-1 | |
ports: | |
- "127.0.0.1:28081:8081" | |
environment: | |
SCHEMA_REGISTRY_HOST_NAME: "ws-schema-registry" | |
SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL: 'ws-zookeeper-1:2181' | |
volumes: | |
ws-zookeeper-1-data: | |
ws-zookeeper-1-log: | |
ws-kafka-1-data: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment