Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- version: '2'
- services:
- zookeeper:
- image: confluentinc/cp-zookeeper:5.2.0
- hostname: zookeeper
- container_name: zookeeper
- ports:
- - '2181:2181'
- environment:
- ZOOKEEPER_CLIENT_PORT: 2181
- ZOOKEEPER_TICK_TIME: 2000
- extra_hosts:
- - "moby:127.0.0.1"
- kafka:
- image: confluentinc/cp-kafka:5.2.0
- hostname: kafka
- container_name: kafka
- ports:
- - '9092:9092'
- depends_on:
- - zookeeper
- environment:
- KAFKA_BROKER_ID: 1
- KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
- KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092
- KAFKA_AUTO_CREATE_TOPICS_ENABLE: "false"
- KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
- extra_hosts:
- - "moby:127.0.0.1"
- schema-registry:
- image: confluentinc/cp-schema-registry:5.2.0
- hostname: schema-registry
- container_name: schema-registry
- depends_on:
- - zookeeper
- - kafka
- ports:
- - '9999:8081'
- environment:
- SCHEMA_REGISTRY_HOST_NAME: schema-registry
- SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL: zookeeper:2181
- extra_hosts:
- - "moby:127.0.0.1"
- kafka-create-topics:
- image: confluentinc/cp-kafka:5.2.0
- depends_on:
- - kafka
- hostname: kafka-create-topics
- command: "bash -c 'echo Waiting for Kafka to be ready... && \
- cub kafka-ready -b kafka:9092 1 20 && \
- kafka-topics --create --topic test --if-not-exists --zookeeper zookeeper:2181 --partitions 1 --replication-factor 1 && \
- sleep infinity'"
- environment:
- KAFKA_BROKER_ID: ignored
- KAFKA_ZOOKEEPER_CONNECT: ignored
- extra_hosts:
- - "moby:127.0.0.1"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement