Created
May 22, 2022 09:13
-
-
Save nobbynobbs/8ee1e4f493168f09dbffd13a76fac8d0 to your computer and use it in GitHub Desktop.
kafka and kafka-ui, without zookeeper
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: '2.4' | |
services: | |
kafka: | |
image: bitnami/kafka:3.1.0 | |
container_name: kafka | |
command: | |
- 'sh' | |
- '-c' | |
- '/opt/bitnami/scripts/kafka/setup.sh && kafka-storage.sh format --config "$${KAFKA_CONF_FILE}" --cluster-id "lkorDA4qT6W1K_dk0LHvtg" --ignore-formatted && /opt/bitnami/scripts/kafka/run.sh' # Kraft specific initialise | |
environment: | |
- ALLOW_PLAINTEXT_LISTENER=yes | |
# Start Kraft Setup (Kafka as Controller - no Zookeeper) | |
- KAFKA_CFG_NODE_ID=1 | |
- KAFKA_CFG_BROKER_ID=1 | |
- [email protected]:9093 | |
- KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT,INTERNAL:PLAINTEXT | |
- KAFKA_CFG_CONTROLLER_LISTENER_NAMES=CONTROLLER | |
- KAFKA_CFG_LOG_DIRS=/tmp/logs | |
- KAFKA_CFG_PROCESS_ROLES=broker,controller | |
- KAFKA_CFG_LISTENERS=PLAINTEXT://:9092,CONTROLLER://:9093,INTERNAL://:9094 | |
# End Kraft Specific Setup | |
- KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://127.0.0.1:9092,INTERNAL://kafka:9094 | |
ports: | |
- "0.0.0.0:9092:9092" | |
kafka-ui: | |
image: provectuslabs/kafka-ui | |
container_name: kafka-ui | |
ports: | |
- "8080:8080" | |
restart: "always" | |
environment: | |
KAFKA_CLUSTERS_0_NAME: "lkorDA4qT6W1K_dk0LHvtg" | |
KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: kafka:9094 | |
depends_on: | |
- kafka |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thanks for this helpful docker compose file