Search by

syp / drupal-project

stefanpetrov

Drupal 11 project template with Drush and the syp/drun task runner.

Package info

gitlab.com/stefan.petrov/drupal-project

Issues

Type:project

pkg:composer/syp/drupal-project

Statistics

Installs: 10

Dependents: 0

Suggesters: 0

Stars: 1

2.01 2026-10-25 12:22 UTC

This package is auto-updated.

Last update: 2026-10-25 12:23:01 UTC


README

A Drupal 11 project template. It is based on drupal/recommended-project, with the web root in web/, and adds Drush and the syp/drun task runner.

Create a project

Composer runs in the platform's dev image, so the host needs Docker, not PHP:

docker run --rm -v "$PWD":/app -w /app registry.gitlab.com/pristan-platform/runtimes/drupal:8.3-dev \
  composer create-project syp/drupal-project mysite
cd mysite
docker compose up -d
git init
docker compose exec web vendor/bin/run git:hooks-install

With PHP and Composer on the host, composer create-project syp/drupal-project mysite and vendor/bin/run git:hooks-install do the same.

create-project runs vendor/bin/run drun:init, which writes these files to the project root:

  • runner.yml
  • phpcs.xml.dist
  • phpstan.neon.dist
  • web/sites/default/settings.php: Pristan's, reading DB_* and DRUPAL_HASH_SALT from the environment. Commit it.

The template also ships settings.site.php (the site's own settings, loaded by Pristan too).

Review runner.yml and commit it. Put machine-specific overrides, such as drun.exec.prefix, in runner.local.yml; git ignores that file.

Everyday commands

The runner and Drush run inside the web container: prefix each with docker compose exec web, as below.

docker compose exec web vendor/bin/run site:install-clean   # install from config/sync, then deploy steps
docker compose exec web vendor/bin/run site:install-dump    # import drun.dump.path, then deploy steps
docker compose exec web vendor/bin/run site:update          # deploy.site.sh, else drush deploy
docker compose exec web vendor/bin/run qa:all               # lint, phpcs, phpstan, composer audit
docker compose exec web vendor/bin/run list                 # everything else

See the syp/drun README for configuration.

Notes

  • The pre-commit hook runs qa:lint and qa:phpcs with the host's PHP when there is one, else in the running web container. Without either it fails: docker compose up -d, then commit again.
  • The first install has no config/sync: run docker compose exec web vendor/bin/drush site:install minimal -y, then docker compose exec web vendor/bin/drush config:export -y, and commit the result. site:install-clean and site:update need it.
  • site:install-dump downloads the sanitised dump with GITLAB_USER and GITLAB_TOKEN (a token with read_api) from the environment; set drun.dump in runner.yml. Pass them into the container with docker compose exec -e GITLAB_USER -e GITLAB_TOKEN web ….
  • in compose.yml publishe the site on 127.0.0.1:8080 only. To reach it from another machine, change the binding to 8080:8080.
  • Drush is a production dependency because deployments need it. syp/drun is a dev dependency, used only locally and in CI.