x-networks: &networks
  networks:
    - default
    - ip6net

services:
  php-amqplib-rabbitmq:
    image:
      rabbitmq:3-management
    ports:
      - "5671:5671"
      - "5672:5672"
      - "15671:15671"
      - "15672:15672"
    volumes:
        - .:/src
    environment:
        - RABBITMQ_CONFIG_FILE=/src/tests/rabbitmq.conf
    <<: *networks

  php-amqplib-toxiproxy:
    image:
      ghcr.io/shopify/toxiproxy:latest
    ports:
      - "8474:8474"
      - "5673:5673"
    depends_on:
      - php-amqplib-rabbitmq
    <<: *networks

networks:
  default:
  ip6net:
    enable_ipv6: true
    ipam:
      config:
        - subnet: 2002:db8::/64
