version: "3"
services:
  postal:
    image: ${POSTAL_IMAGE}
    depends_on:
      - mariadb
      - rabbitmq
    entrypoint: ["/docker-entrypoint.sh"]
    volumes:
      - "./docker/ci-config:/config"
    environment:
      POSTAL_CONFIG_ROOT: /config
      KATAPULT_CONFIG_FILE: /ci-config.yml
      WAIT_FOR_TIMEOUT: 90
      WAIT_FOR_TARGETS: |-
        mariadb:3306
        rabbitmq:5672

  mariadb:
    image: mariadb
    restart: always
    environment:
      MARIADB_DATABASE: postal
      MARIADB_ALLOW_EMPTY_PASSWORD: 'yes'
      MARIADB_ALLOW_EMPTY_ROOT_PASSWORD: 'yes'

  rabbitmq:
    image: rabbitmq:3
    restart: always
