version: '3'
services:
  php:
    build: ./docker/php
    volumes:
      - .:/src
    working_dir: /src
    environment:
      - TEST_RABBITMQ_HOST=rabbitmq
      - TOXIPROXY_HOST=proxy
      - TOXIPROXY_AMQP_PORT=5673
    depends_on:
      - rabbitmq
      - proxy
    entrypoint: ['tail', '-f', '/dev/null']

  rabbitmq:
    image: rabbitmq:3.11-management
    ports:
      - "5671:5671"
      - "5672:5672"
      - "15671:15671"
    volumes:
        - .:/src
    environment:
        - RABBITMQ_CONFIG_FILE=/src/tests/rabbitmq.conf

  proxy:
    image: ghcr.io/shopify/toxiproxy:2.5.0
    ports:
      - "8474:8474"
      - "5673:5673"
    depends_on:
      - rabbitmq
