Last active
July 24, 2022 21:54
-
-
Save rednafi/6e367f456edce496d6fdd250c222c733 to your computer and use it in GitHub Desktop.
Single node kafka, zookeeper, and schema-registry with docker compose 3
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.9' | |
services: | |
zoo1: | |
image: confluentinc/cp-zookeeper:7.2.0 | |
container_name: zoo1 | |
environment: | |
ZOOKEEPER_CLIENT_PORT: 2181 | |
ZOOKEEPER_TICK_TIME: 2000 | |
kafka1: | |
image: confluentinc/cp-kafka:7.2.0 | |
container_name: kafka1 | |
ports: | |
# To learn about configuring Kafka for access across networks see | |
# https://www.confluent.io/blog/kafka-client-cannot-connect-to-broker-on-aws-on-docker-etc/ | |
- "9092:9092" | |
depends_on: | |
- zoo1 | |
environment: | |
KAFKA_BROKER_ID: 1 | |
KAFKA_ZOOKEEPER_CONNECT: 'zoo1:2181' | |
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_INTERNAL:PLAINTEXT | |
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:9092,PLAINTEXT_INTERNAL://kafka1:29092 | |
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 | |
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1 | |
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1 | |
kafka-schema-registry: | |
image: confluentinc/cp-schema-registry:7.2.0 | |
hostname: kafka-schema-registry | |
container_name: kafka-schema-registry | |
depends_on: | |
- zoo1 | |
- kafka1 | |
ports: | |
- "8081:8081" | |
environment: | |
SCHEMA_REGISTRY_HOST_NAME: kafka-schema-registry | |
SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS: 'PLAINTEXT://kafka1:29092' | |
SCHEMA_REGISTRY_LISTENERS: http://0.0.0.0:8081 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment