version: '3.8'

services:
  php-7.4: &php
    build:
      target: php
      args:
        ALPINE_VERSION: "3.16"
        PHP_VERSION: "7.4"
        PHP_XDEBUG_VERSION: "3.1.6"
    working_dir: /fixer
    volumes:
      - .:/fixer
    environment:
      PHP_IDE_CONFIG: serverName=php-cs-fixer
      PHP_CS_FIXER_ALLOW_XDEBUG: 1

  php-8.0:
    <<: *php
    build:
      args:
        ALPINE_VERSION: "3.16"
        PHP_VERSION: "8.0"
        PHP_XDEBUG_VERSION: "3.2.2"

  php-8.1:
    <<: *php
    build:
      args:
        PHP_VERSION: "8.1"
        PHP_XDEBUG_VERSION: "3.2.2"

  php-8.2:
    <<: *php
    build:
      args:
        PHP_VERSION: "8.2"
        PHP_XDEBUG_VERSION: "3.2.2"

  php-8.3:
    <<: *php
    build:
      args:
        PHP_VERSION: "8.3"
        PHP_XDEBUG_VERSION: "3.3.0"

  sphinx-lint:
    build:
      target: sphinx-lint
    working_dir: /fixer
    volumes:
      - .:/fixer

  markdown-lint:
    image: registry.gitlab.com/pipeline-components/markdownlint:latest
    command: mdl --git-recurse .
    working_dir: /fixer
    volumes:
      - .:/fixer
