version: '2'
services:
  zookeeper:
    container_name: kafka-zk
    image: zookeeper:3.7.0
    ports:
      - "2181:2181"
      - "2888:2888"
      - "3888:3888"
    restart: always
    environment:
      TZ: CST-8
  kafka:
    container_name: kafka-server
    image: wurstmeister/kafka:2.13-2.7.0
    ports:
      - "9092:9092"
      - "1099:1099"
      - "9999:9999"
    environment:
      TZ: CST-8
      HOSTNAME: B144
      KAFKA_ADVERTISED_HOST_NAME: 104.225.146.144
      KAFKA_CREATE_TOPICS: "test:1:1"
      KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
      KAFKA_LOG_RETENTION_HOURS: 72
      KAFKA_JMX_OPTS: "-Djava.rmi.server.hostname=104.225.146.144 -Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.authenticate=false  -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=1099 -Dcom.sun.management.jmxremote.rmi.port=9999"
      JMX_PORT: 1099
    restart: always
    volumes:
      - /usr/local/dockerfs/kafka/logs:/kafka
      - /usr/local/dockerfs/kafka/docker.sock:/var/run/docker.sock
