name: docker-example-drupal
language: php
type: drupal-project

web:
  type: nginx

database:
  type: mariadb
  version: 10

php:
  version: 8.1-fpm-bullseye
  phpcs:
    standard: Drupal,DrupalPractice
  phpstan:
    level: max

drupal:
  docroot: web

docker-compose:
  services:
    database: ~
    php:
      build:
        target: build

dockerfile:
  stages:
    build:
      extends: base
      packages:
        - git
        - libpng-dev
        - libzip-dev
        - mariadb-client
        - unzip
      extensions:
        install:
          - gd
          - pdo_mysql
          - zip
      commands:
        - composer validate
        - composer install

    test:
      extends: base
      commands:
        - parallel-lint src --no-progress
        - phpcs -vv
        - phpstan
        - phpunit --testdox

experimental:
  createGitHubActionsConfiguration: true
  useNewDatabaseCredentials: true