version: '3'

services:
  php-7.2:
    volumes:
      - php72:/workdir
      - "./src:/workdir/src:ro"
      - "./tests:/workdir/tests:ro"
      - "./composer.json:/workdir/composer.json:ro"
    build:
      context: .
      dockerfile: Dockerfile-tests
      args:
        IMAGE: php:7.2-cli-alpine
        PACKAGES: git zip unzip icu-dev

  php-7.2_intl:
    volumes:
      - php72_intl:/workdir
      - "./src:/workdir/src:ro"
      - "./tests:/workdir/tests:ro"
      - "./composer.json:/workdir/composer.json:ro"
    build:
      context: .
      dockerfile: Dockerfile-tests
      args:
        IMAGE: php:7.2-cli-alpine
        PACKAGES: git zip unzip icu-dev
        PHPMODS: intl


  php-7.3:
    volumes:
      - php73:/workdir
      - "./src:/workdir/src:ro"
      - "./tests:/workdir/tests:ro"
      - "./composer.json:/workdir/composer.json:ro"
    build:
      context: .
      dockerfile: Dockerfile-tests
      args:
        IMAGE: php:7.3-cli-alpine
        PACKAGES: git zip unzip icu-dev

  php-7.3_intl:
    volumes:
      - php73_intl:/workdir
      - "./src:/workdir/src:ro"
      - "./tests:/workdir/tests:ro"
      - "./composer.json:/workdir/composer.json:ro"
    build:
      context: .
      dockerfile: Dockerfile-tests
      args:
        IMAGE: php:7.3-cli-alpine
        PACKAGES: git zip unzip icu-dev
        PHPMODS: intl


  php-7.4:
    volumes:
      - php74:/workdir
      - "./src:/workdir/src:ro"
      - "./tests:/workdir/tests:ro"
      - "./composer.json:/workdir/composer.json:ro"
    build:
      context: .
      dockerfile: Dockerfile-tests
      args:
        IMAGE: php:7.4-cli-alpine
        PACKAGES: git zip unzip icu-dev

  php-7.4_intl:
    volumes:
      - php74_intl:/workdir
      - "./src:/workdir/src:ro"
      - "./tests:/workdir/tests:ro"
      - "./composer.json:/workdir/composer.json:ro"
    build:
      context: .
      dockerfile: Dockerfile-tests
      args:
        IMAGE: php:7.4-cli-alpine
        PACKAGES: git zip unzip icu-dev
        PHPMODS: intl


  php-8.0:
    volumes:
      - php80:/workdir
      - "./src:/workdir/src:ro"
      - "./tests:/workdir/tests:ro"
      - "./composer.json:/workdir/composer.json:ro"
    build:
      context: .
      dockerfile: Dockerfile-tests
      args:
        IMAGE: php:8.0-cli-alpine
        PACKAGES: git zip unzip icu-dev

  php-8.0_intl:
    volumes:
      - php80_intl:/workdir
      - "./src:/workdir/src:ro"
      - "./tests:/workdir/tests:ro"
      - "./composer.json:/workdir/composer.json:ro"
    build:
      context: .
      dockerfile: Dockerfile-tests
      args:
        IMAGE: php:8.0-cli-alpine
        PACKAGES: git zip unzip icu-dev
        PHPMODS: intl


volumes:
  php72:
  php72_intl:
  php73:
  php73_intl:
  php74:
  php74_intl:
  php80:
  php80_intl: