From 36f28137082270f0910ea1ae9e400f23a4f37607 Mon Sep 17 00:00:00 2001 From: Luke Else Date: Thu, 6 Feb 2025 14:40:06 +0000 Subject: [PATCH] Added kafka service to server --- Kafka/docker-compose.yml | 40 ++++++++++++++++++++++++++++++++++++++++ main-spindown.sh | 4 ++++ main-spinup.sh | 4 ++++ todo.md | 5 +++-- 4 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 Kafka/docker-compose.yml diff --git a/Kafka/docker-compose.yml b/Kafka/docker-compose.yml new file mode 100644 index 0000000..541c89c --- /dev/null +++ b/Kafka/docker-compose.yml @@ -0,0 +1,40 @@ +version: '3.8' + +services: + zookeeper: + image: confluentinc/cp-zookeeper:latest + container_name: zookeeper + restart: always + environment: + ZOOKEEPER_CLIENT_PORT: 2181 + ZOOKEEPER_TICK_TIME: 2000 + networks: + - kafka_network + + kafka: + image: confluentinc/cp-kafka:latest + container_name: kafka + restart: always + depends_on: + - zookeeper + networks: + - kafka_network + - proxy + environment: + KAFKA_BROKER_ID: 1 + KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 + KAFKA_LISTENERS: PLAINTEXT://kafka:9092 + KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092 + KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 + labels: + - "traefik.enable=true" + - "traefik.tcp.routers.kafka.rule=HostSNI(`*`)" + - "traefik.tcp.routers.kafka.entrypoints=kafka" + - "traefik.tcp.routers.kafka.service=kafka" + - "traefik.tcp.services.kafka.loadbalancer.server.port=9092" + +networks: + kafka_network: + driver: bridge + proxy: + external: true diff --git a/main-spindown.sh b/main-spindown.sh index db5219b..18ba3eb 100644 --- a/main-spindown.sh +++ b/main-spindown.sh @@ -21,6 +21,10 @@ cd ./Bitwarden/ docker-compose down cd .. +cd ./Kafka/ +docker-compose down +cd .. + cd ./Misc/ docker-compose down cd .. diff --git a/main-spinup.sh b/main-spinup.sh index 71b1811..24f6b77 100644 --- a/main-spinup.sh +++ b/main-spinup.sh @@ -26,6 +26,10 @@ cd ./Bitwarden/ docker-compose pull && docker-compose up -d cd .. +cd ./Kafka/ +docker-compose pull && docker-compose up -d +cd .. + cd ./Misc/ docker-compose pull && docker-compose up -d cd .. \ No newline at end of file diff --git a/todo.md b/todo.md index 79c728e..8d9e498 100644 --- a/todo.md +++ b/todo.md @@ -10,7 +10,7 @@ - ssh - ftp - 27017 - - 3306 + - 9092 - Install SSH keys - Setup unattended upgrades @@ -33,9 +33,10 @@ Create a .env file with the following content: -``` +```sh ACKEE_USERNAME=luke-else ACKEE_PASSWORD=XXX + ``` ## Websites