version: '2'

services:
  zookeeper:
    image: wurstmeister/zookeeper:3.4.6
    ports:
      - "2181:2181"
    environment:
      LOG_DIR: "/tmp/logs"

  kafka:
    image: wurstmeister/kafka:2.12-2.2.1
    depends_on:
      - zookeeper
    ports:
      - "9092:9092"
    expose:
      - "9093"
    environment:
      KAFKA_ADVERTISED_LISTENERS: INSIDE://kafka:9093,OUTSIDE://localhost:9092
      KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INSIDE:PLAINTEXT,OUTSIDE:PLAINTEXT
      KAFKA_LISTENERS: INSIDE://0.0.0.0:9093,OUTSIDE://0.0.0.0:9092
      KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
      KAFKA_INTER_BROKER_LISTENER_NAME: INSIDE
      LOG_DIR: "/tmp/logs"

  kafdrop:
    image: obsidiandynamics/kafdrop
    depends_on:
      - kafka
    ports:
      - "9000:9000"
    environment:
      KAFKA_BROKERCONNECT: "kafka:9093"
      JVM_OPTS: "-Xms32M -Xmx64M"
      SERVER_SERVLET_CONTEXTPATH: "/"

  infinispan:
    image: infinispan/server:11.0.4.Final
    container_name: infinispan
    ports:
      - 11222:11222
    command: "/opt/infinispan/bin/server.sh -c infinispan-demo.xml"
    volumes:
      - ./infinispan/infinispan.xml:/opt/infinispan/server/conf/infinispan-demo.xml:z

  kogito-app:
    image: org.kie.kogito/integration-tests-trusty-service-quarkus:2.0.0-SNAPSHOT
    ports:
      - 8080:8080
    environment:
      KAFKA_BOOTSTRAP_SERVERS: kafka:9093
      KOGITO_SERVICE_URL: http://kogito-app:8080
    depends_on:
      - kafka

  explainability:
    image: org.kie.kogito/explainability-service-messaging:2.0.0-SNAPSHOT
    depends_on:
      - kafka
      - kogito-app
    environment:
      KAFKA_BOOTSTRAP_SERVERS: kafka:9093
    ports:
      - 1336:8080

  trusty:
    image: org.kie.kogito/trusty-service-infinispan:2.0.0-SNAPSHOT
    depends_on:
      - kafka
      - infinispan
    environment:
      KAFKA_BOOTSTRAP_SERVERS: kafka:9093
      QUARKUS_INFINISPAN_CLIENT_SERVER_LIST: infinispan:11222
      QUARKUS_INFINISPAN_CLIENT_USE_AUTH: "false"
      TRUSTY_EXPLAINABILITY_ENABLED: "true"
    ports:
      - 1337:8080

  trusty-ui:
    image: org.kie.kogito/trusty-ui:2.0.0-SNAPSHOT
    depends_on:
      - kafka
    environment:
      KOGITO_TRUSTY_HTTP_URL: http://localhost:1337
    ports:
      - 1338:8080
