Check out the branches for each version of Drupal supported by this repository.
This container includes:
An example of usage can be found at example.
-
Create a
Dockerfile
withFROM weahead/drupal:<tag>
. Wheretag
is a version number like7.51.0
. -
Make sure you add
VOLUME /var/www/html
to the end of yourDockerfile
. -
Create a folder named
app
next toDockerfile
. -
Drupal packages, like themes and modules, are installed with Composer. Create a file named
composer.json
atapp/composer.json
and specify your requirements there.See example/app/composer.json for example content.
More information can be found in Drupals Community Documentation.
-
Optionally, place a
settings.php
file atapp/settings.php
. It will be installed in the correct place inside the container at build time. Skip this step if you plan on running the Drupal installation steps rather than importing an existing installation. -
Place custom themes to develop in folder
app/themes
. -
Place custom modules to develop in folder
app/modules
.This gives you a folder structure like this:
. ├── Dockerfile ├── app │ ├── composer.json │ ├── settings.php │ ├── modules │ │ ├── custom-module1 │ │ ├── custom-module2 │ │ └── ... │ └── themes │ ├── custom-theme │ └── ... └── ...
-
Build it with
docker build -t <name>:<tag> .
To use additional services, like using node to watch files and compile on save, S6 supervision can be used. More information on how to use S6 can be found in their documentation.
The recommended way is to use COPY root /
in a descendant Dockerfile
with
the directory structure found in example/root.