version: '3'
services:
  kafka1:
    image: wurstmeister/kafka
    container_name: kafka-multi-binder-1
    ports:
      - "9092:9092"
    environment:
      - KAFKA_ADVERTISED_HOST_NAME=127.0.0.1
      - KAFKA_ADVERTISED_PORT=9092
      - KAFKA_ZOOKEEPER_CONNECT=zookeeper1:2181
    depends_on:
      - zookeeper1
  zookeeper1:
    image: wurstmeister/zookeeper
    ports:
      - "2181:2181"
    environment:
      - KAFKA_ADVERTISED_HOST_NAME=zookeeper1
  kafka2:
    image: wurstmeister/kafka
    container_name: kafka-multi-binder-2
    ports:
      - "9093:9092"
    environment:
      - KAFKA_ADVERTISED_HOST_NAME=127.0.0.1
      - KAFKA_ADVERTISED_PORT=9092
      - KAFKA_ZOOKEEPER_CONNECT=zookeeper2:2181
    depends_on:
      - zookeeper2
  zookeeper2:
    image: wurstmeister/zookeeper
    ports:
      - "2182:2181"
    environment:
      - KAFKA_ADVERTISED_HOST_NAME=zookeeper2