From 9462d7a950c4d09985dd58bc6a27a51f274f9fad Mon Sep 17 00:00:00 2001 From: Ollie Batchelor Date: Fri, 22 Dec 2023 11:10:57 +0000 Subject: [PATCH] add kafka docker compose --- rust-containers-k8s/docker-compose.yaml | 31 ++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/rust-containers-k8s/docker-compose.yaml b/rust-containers-k8s/docker-compose.yaml index 2d9b4d6..498e099 100644 --- a/rust-containers-k8s/docker-compose.yaml +++ b/rust-containers-k8s/docker-compose.yaml @@ -3,7 +3,7 @@ version: "3.8" services: postgres: - image: postgres:16.1 + image: postgres:15.5 restart: always volumes: - .//database/docker-postgresql-multiple-databases:/docker-entrypoint-initdb.d @@ -12,3 +12,32 @@ services: POSTGRES_PASSWORD: commerce ports: - 5432:5432 + zookeeper: + restart: always + image: docker.io/bitnami/zookeeper:3.8 + ports: + - "2181:2181" + volumes: + - "zookeeper-volume:/bitnami" + environment: + - ALLOW_ANONYMOUS_LOGIN=yes + kafka: + restart: always + image: docker.io/bitnami/kafka:3.3 + ports: + - "9093:9093" + volumes: + - "kafka-volume:/bitnami" + environment: + - KAFKA_BROKER_ID=1 + - KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper:2181 + - ALLOW_PLAINTEXT_LISTENER=yes + - KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=CLIENT:PLAINTEXT,EXTERNAL:PLAINTEXT + - KAFKA_CFG_LISTENERS=CLIENT://:9092,EXTERNAL://:9093 + - KAFKA_CFG_ADVERTISED_LISTENERS=CLIENT://kafka:9092,EXTERNAL://localhost:9093 + - KAFKA_CFG_INTER_BROKER_LISTENER_NAME=CLIENT + depends_on: + - zookeeper +volumes: + kafka-volume: + zookeeper-volume: \ No newline at end of file