---
version: '3'

services:

  zookeeper:
    image: strimzi/kafka:0.20.1-kafka-2.6.0
    command: [
      "bin/zookeeper-server-start.sh", "config/zookeeper.properties"
    ]
    ports:
      - "2181:2181"
    environment:
      LOG_DIR: /tmp/logs
    cap_drop:
      - NET_RAW

  kafka:
    image: strimzi/kafka:0.20.1-kafka-2.6.0
    command: [
      "bin/kafka-server-start.sh", "config/server.properties",
      "--override", "listeners=PLAINTEXT://0.0.0.0:9092",
      "--override", "advertised.listeners=PLAINTEXT://localhost:9092",
      "--override", "zookeeper.connect=zookeeper:2181"
    ]
    depends_on:
      - zookeeper
    ports:
      - "9092:9092"
    environment:
      LOG_DIR: "/tmp/logs"
      KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:9092
      KAFKA_LISTENERS: PLAINTEXT://0.0.0.0:9092
      KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
    cap_drop:
      - NET_RAW