github.com/deanMdreon/kafka-go@v0.4.32/docker-compose.010.yml (about)

     1  version: "3"
     2  services:
     3    kafka:
     4      image: wurstmeister/kafka:0.10.1.1
     5      links:
     6      - zookeeper
     7      ports:
     8      - 9092:9092
     9      - 9093:9093
    10      environment:
    11        KAFKA_BROKER_ID: '1'
    12        KAFKA_CREATE_TOPICS: 'test-writer-0:3:1,test-writer-1:3:1'
    13        KAFKA_DELETE_TOPIC_ENABLE: 'true'
    14        KAFKA_ADVERTISED_HOST_NAME: 'localhost'
    15        KAFKA_ADVERTISED_PORT: '9092'
    16        KAFKA_ZOOKEEPER_CONNECT: 'zookeeper:2181'
    17        KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'true'
    18        KAFKA_MESSAGE_MAX_BYTES: '200000000'
    19        KAFKA_LISTENERS: 'PLAINTEXT://:9092,SASL_PLAINTEXT://:9093'
    20        KAFKA_ADVERTISED_LISTENERS: 'PLAINTEXT://localhost:9092,SASL_PLAINTEXT://localhost:9093'
    21        KAFKA_SASL_ENABLED_MECHANISMS: 'PLAIN'
    22        KAFKA_OPTS: "-Djava.security.auth.login.config=/opt/kafka/config/kafka_server_jaas.conf"
    23        CUSTOM_INIT_SCRIPT: |-
    24          echo -e 'KafkaServer {\norg.apache.kafka.common.security.plain.PlainLoginModule required\n username="adminplain"\n password="admin-secret"\n user_adminplain="admin-secret";\n  };' > /opt/kafka/config/kafka_server_jaas.conf;
    25  
    26    zookeeper:
    27      image: wurstmeister/zookeeper
    28      ports:
    29      - 2181:2181