Skip to content

Niklan/Docker4DrupalContrib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker4DrupalContrib

Creating a development environment for Drupal is tedious. This project is an attempt to make it a bit easier.

Tools included

  • Docker4Drupal as a foundation with a small adjustments. All documentation from D4D is applicable for this project.
  • drupalrc for simplified interaction with Drupal related tools from the CLI.

How to use

Tip

This workflow is intended to be used for each contrib module separately. This means all these steps should be repeated for each individual contrib module.

  • Clone this repository:
    git clone git@github.com:Niklan/Docker4DrupalContrib.git DRUPAL_PROJECT_NAME
  • Adjust .env file: drupal core version, project name, PHP version etc.
  • Clone contrib module into /project:
    git clone git@git.drupal.org:project/DRUPAL_PROJECT_NAME.git project
  • Run the containers and enjoy!
    docker compose up -d

Example with pathauto module

git clone git@github.com:Niklan/Docker4DrupalContrib.git pathauto
cd pathauto
git clone git@git.drupal.org:project/pathauto.git project
# Note: this will also affects 'DRUPAL_PROJECT_NAME' which is expected.
sed -i 's/PROJECT_NAME=/PROJECT_NAME=pathauto/g' .env
docker compose up -d
docker compose exec php bash
# Navigate into module dir.
dcd pathauto
# Run PHPCS
drupalcs .
# Run PHPUnit
dunit .

FAQ

How to rebuild containers from scratch?

docker compose down -v
docker compose build --no-cache
docker compose up -d

How to rebuild just composer.json file?

  1. Enter to php container shell:
docker compose exec php bash
  1. Run:
build-composer-json

Hot to run tool X?

This is where drupalrc will come to rescue.

First, you have to enter into shell (note that it should bash, not sh):

docker compose exec php bash

Then you can use drupalrc:

  • Navigate to module sources (you can type it manually instead of using env):
    dcd $DRUPAL_PROJECT_NAME
  • PHPCS
    drupalcs .
  • PHPUnit
    dunit .

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published