version: '3.7'
services:
  zookeeper:
    container_name: zookeeper
    image: docker.io/bitnami/zookeeper:3.8
    ports:
      - "2181:2181"
    volumes:
      - "zookeeper_data:/bitnami"
    environment:
      - ALLOW_ANONYMOUS_LOGIN=yes
  microkafka:
    container_name: microkafka
    image: microuniverso/microkafka:##VERSAO_MICROKAFKA
    volumes:
      - "microkafka:/bitnami"
    environment:
      - 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://0.0.0.0:9093
      - KAFKA_CFG_ADVERTISED_LISTENERS=CLIENT://microkafka:9092,EXTERNAL://##MICRO_KAFKA_HOST:9093
      - KAFKA_CFG_INTER_BROKER_LISTENER_NAME=CLIENT
  configurar-microkafka:
    image: microuniverso/configurar-microkafka:##VERSAO_CONFIGURACAO
    container_name: configurar-microkafka
    depends_on:
      - microkafka
volumes:
  zookeeper_data:
    driver: local
  microkafka:
    driver: local