Drupal Project
Use this project as a template for working on Drupal core and contrib modules., (*1)
Requirements
Most of the dev tools are in the php Docker container, but you will need one or two
out side of that., (*2)
This includes:, (*3)
- PHP 7.1+
- Git
- and [Composer][5].
If you don't have these installed, then follow the instructions for your specific
platform., (*4)
MacOS
Download and install Homebrew follow the online instructions., (*5)
Add the php tap:, (*6)
brew tap homebrew/homebrew-php
brew install git composer php71 php71-mcrypt php71-xdebug
Windows
TBC, (*7)
Installing
To create a new project in a directory called `myproject' run the following
command., (*8)
composer create-project --no-install -s dev previousnext/drupal-project myproject
Docker
You will need to install Docker and related tools., (*9)
OS-specific Installation
MacOS
Download and install Docker for Mac, (*10)
Windows
Download and install Docker for Windows, (*11)
Download and install Make for Windows, (*12)
Linux
You know what you're doing, right?, (*13)
Docker Compose
Due to networking, and file system performance issues in Docker for Mac, you
need a slightly different docker-compose.yml file for MacOS. To simplify your
commands, we recommend creating an alias in ~/.bashrc
such as:, (*14)
alias dc='docker-compose -f docker-compose.osx.yml'
To start the container, run:, (*15)
dc up -d
Setup and Install Drupal
For simplicity, run all commands from within the php container. You can get
shell access via:, (*16)
dc exec app bash
To initialise your local dev environment run the following:, (*17)
make install
Developer Options
To set up common developer options, run:, (*18)
make devify
Install a contrib module
The easiest way to install a contrib module to work on is via composer., (*19)
For example, to work on pathauto, type the following:, (*20)
composer require drupal/pathauto --prefer-source
Testing
To run tests, run:, (*21)
make test