services:
  rabbit:
    container_name: rabbit
    image: rabbitmq:3-management
    ports:
      - "15672:15672"
      - "5672:5672"
      - "5671:5671"
    networks:
      - local
  publisher:
    build: ./publisher-app
    container_name: publisher
    depends_on:
      - rabbit
    environment:
      RABBIT_HOST: rabbit
      RABBIT_PORT: 5672
    networks:
      - local
  consumer-1:
    build: ./consumer-app
    container_name: consumer-1
    depends_on:
      - rabbit
      - publisher
    environment:
      RABBIT_HOST: rabbit
      RABBIT_PORT: 5672
      PROCESS_DELAY: 3000
      QUEUE_NAME: queue1
      EXCHANGE_NAME: order-events
    networks:
      - local
  consumer-2:
    build: ./consumer-app
    container_name: consumer-2
    depends_on:
      - rabbit
      - publisher
    environment:
      RABBIT_HOST: rabbit
      RABBIT_PORT: 5672
      PROCESS_DELAY: 0
      QUEUE_NAME: queue2
      EXCHANGE_NAME: order-events
    networks:
      - local
  consumer-12:
    build: ./consumer-app
    container_name: consumer-12
    depends_on:
      - rabbit
      - publisher
    environment:
      RABBIT_HOST: rabbit
      RABBIT_PORT: 5672
      PROCESS_DELAY: 3000
      QUEUE_NAME: queue1
      EXCHANGE_NAME: order-events
    networks:
      - local
  consumer-13:
    build: ./consumer-app
    container_name: consumer-13
    depends_on:
      - rabbit
      - publisher
    environment:
      RABBIT_HOST: rabbit
      RABBIT_PORT: 5672
      PROCESS_DELAY: 3000
      QUEUE_NAME: queue1
      EXCHANGE_NAME: order-events
    networks:
      - local

networks:
  local: