services:
  php-7.4: &php
    build:
      target: php
      args: &base_build_args
        DOCKER_USER_ID: ${DOCKER_USER_ID:-1000}
        DOCKER_GROUP_ID: ${DOCKER_GROUP_ID:-1000}
    user: ${DOCKER_USER_ID:-1000}:${DOCKER_GROUP_ID:-1000}
    extra_hosts:
      # Allow container to connect to host to use XDebug step debugging.
      # This is not needed when using Docker Desktop as it supports this natively.
      - 'host.docker.internal:host-gateway'
    environment:
      XDEBUG_MODE: ${XDEBUG_MODE:-off}
      XDEBUG_CONFIG: 'idekey=${XDEBUG_IDEKEY:-PHPSTORM} client_host=${XDEBUG_CLIENT_HOST:-host.docker.internal}'
  php-8.0:
    <<: *php
  php-8.1:
    <<: *php
  php-8.2:
    <<: *php
  php-8.3:
    <<: *php
