Kafka - Docker compose example for Kafka

less than 1 minute read

Kafka docker compose example. Please set value of KAFKA_ADVERTISED_HOST_NAME for local host IP address.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
version: '2.1'
services:
  zookeeper:
    image: wurstmeister/zookeeper:3.4.6
    ports:
      - "2181:2181"
  kafka:
    image: wurstmeister/kafka:2.12-2.2.0
    ports:
      - '9092:9092'
    tmpfs:
      - /kafka/:rw
    depends_on:
      - zookeeper
    environment:
      KAFKA_ADVERTISED_HOST_NAME: [HOST_IPADDRESS]
      KAFKA_ZOOKEEPER_CONNECT: 'zookeeper:2181'