version: '2.1'
services:
  zookeeper:
    image: zookeeper:3.4.10
    ports:
      - "2181:2181"

  kafka:
    image: confluentinc/cp-kafka:3.2.1
    ports:
      - "9092:9092"
    environment:
      KAFKA_ZOOKEEPER_CONNECT: "zookeeper:2181"
      KAFKA_ADVERTISED_LISTENERS: "PLAINTEXT://kafka:9092"
    depends_on:
      - zookeeper

  kafka-schema-registry:
    image: confluentinc/cp-schema-registry:3.2.1
    ports:
      - "8001:8001"
    environment:
      SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL: zookeeper:2181
      SCHEMA_REGISTRY_HOST_NAME: kafka-schema-registry
      SCHEMA_REGISTRY_LISTENERS: http://kafka-schema-registry:8001
    depends_on:
      - zookeeper
      - kafka

  kafka-rest-proxy:
    image: confluentinc/cp-kafka-rest:3.2.1
    ports:
      - "8082:8082"
    environment:
      KAFKA_REST_ZOOKEEPER_CONNECT: zookeeper:2181
      KAFKA_REST_LISTENERS: http://kafka-rest-proxy:8082/
      KAFKA_REST_SCHEMA_REGISTRY_URL: http://kafka-schema-registry:8001/
      KAFKA_REST_HOST_NAME: kafka-rest-proxy
    depends_on:
      - zookeeper
      - kafka
      - kafka-schema-registry

  kafka-topics-ui:
    image: landoop/kafka-topics-ui:0.8.3
    ports:
      - "8002:8000"
    environment:
      KAFKA_REST_PROXY_URL: http://kafka-rest-proxy:8082/
      PROXY: "true"
    depends_on:
      - kafka-rest-proxy

  schema-registry-ui:
    image: landoop/schema-registry-ui:0.9.1
    ports:
      - "8003:8000"
    environment:
      SCHEMAREGISTRY_URL: http://kafka-schema-registry:8001/
      PROXY: "true"
    depends_on:
      - kafka-schema-registry
