Drupal is NOT included with this image! See How to use this image.
- Apache 2.4
- Drupal Console Launcher
- Drush Launcher
- ImageMagick
- PHP (latest 7.2 release)
- PHP Extensions:
- exif
- gd
- mbstring
- mysqli
- opcache
- pdo
- pdo_mysql
- uploadprogress
- zip
- sSMPT (Simple SMTP)
- 80 (HTTP)
- 443 (HTTPS)
This image is designed to serve a Drupal project, built from the Composer template for Drupal projects, from the /var/www/html directory. Below are two example methods for getting a Drupal installation into the /var/www/html directory.
This is the recommended method for production and allows for rapidly deploying drupal containers.
The example Dockerfile below copies an existing Drupal installation from the host (/path/to/drupal) to the /var/www/html path inside the project-specific image.
FROM jantoine/drupal:8
# Copy the Drupal files into the container.
COPY /path/to/drupal /var/www/html
RUN chown -R www-data:www-data /var/www/html
This is the recommended method for development and allows changes to files on the host to be reflected inside the container.
This first example bind mounts an existing Drupal installation on the host (/path/to/drupal) to the /var/www/html path in the container.
-v /path/to/drupal:/var/www/html
This second example bind mounts the parent directory of a Drupal installation on the host (/path/to/drupal/parent) to the /var/www path in the container, with Drupal being installed in the 'html' sub-directory.
-v /path/to/drupal/parent:/var/www
Drupal can be configured to use various database backends, so a database backend is not included and must be linked in. The example below links the 'database_container' into our Drupal container and makes it accessible via the hostname 'db'.
--link database_container:db
sSMTP is used as the system's MTA (Mail Transfer Agent) which forwards messages to the MTA of a mailhub. sSMTP is configured to send mail to a mailhub accessible via the 'mail' hostname. The example below links the 'mailhub_container' into our Druapl container and makes it accessible via the hostname 'mail'.
--link mailhub_container:mail
The basic pattern for starting a jantoine/drupal instance is:
$ docker run --name drupal_container -P -v /path/to/drupal:/var/www/html --link database_container:db --link mailhub_container:mail -d jantoine/drupal
To easily access the container via a desired hostname, create an nginx-proxy
container and pass the hostname to the Drupal container.
The example below would make the Drupal container accessible via the example.com hostname.
-e VIRTUAL_HOST=example.com
This image also provides a REMOTE_FILE_SERVER environment variable for defining a remote server to fetch files from if they're not found locally.
-e REMOTE_FILE_SERVER=example.net