version: '2'
volumes:
  data-volume: {}
services:
  mysql:
    image: mariadb
    ports:
      - "3306:3306"
    environment:
      MYSQL_ROOT_PASSWORD: pwd
      MYSQL_DATABASE: sample_mysql_db
    volumes:
      - data-volume:/var/lib/mysql
  kafka:
    image: wurstmeister/kafka
    ports:
      - "9092:9092"
    environment:
      - KAFKA_ADVERTISED_HOST_NAME=127.0.0.1
      - KAFKA_ADVERTISED_PORT=9092
      - KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181
    depends_on:
      - zookeeper
  zookeeper:
    image: wurstmeister/zookeeper
    ports:
      - "2181:2181"
    environment:
      - KAFKA_ADVERTISED_HOST_NAME=zookeeper
  rabbitmq:
    image: rabbitmq:management
    ports:
      - 5672:5672
      - 15672:15672

  # used for multi Kafka cluster testing

  kafka2:
    image: wurstmeister/kafka
    container_name: kafka-2
    ports:
      - "9093:9092"
    environment:
      - KAFKA_ADVERTISED_HOST_NAME=127.0.0.1
      - KAFKA_ADVERTISED_PORT=9092
      - KAFKA_ZOOKEEPER_CONNECT=zookeeper2:2181
    depends_on:
      - zookeeper2
  zookeeper2:
    image: wurstmeister/zookeeper
    ports:
      - "2182:2181"
    environment:
      - KAFKA_ADVERTISED_HOST_NAME=zookeeper2