A lightweight extensible Drupal docker image, suitable for a development-to-production workflow.
This image does not contain a database (MySQL) server, although the docker-compose.yml file provided for convenience will deploy Drupal with a MySQL server with no additional configuration required. Looking for a really quick start?
git clone -b alpine-nginx-php7-8.x-composer firstname.lastname@example.org:unb-libraries/docker-drupal.git docker-drupal cd docker-drupal docker-compose up -d; docker-compose logs
And that's it! Don't have docker/docker-compose installed? See the wiki pages. New to Docker? Completely lost and not sure where to start? Check out the unblibraries/drupal Wiki for detailed instructions on deploying a local Drupal instance.
How To Use
This image offers little benefit on its own, and shines when serving as the base of an extension. Although little documentation exists, an example of how we extend this image for a production site should provide enough for you to get started.
This image was previously available in many configurations and formats, which became a tremendous maintenance burden.There is currently only one supported branch - Drupal 8 and PHP7 built by Composer.
The other branches have been deprecated and will not be updated. They will most likely become broken! If you wish to contribute to the project and maintain these other configurations, please contact us.
docker run \ --rm \ --name drupal \ -e MYSQL_HOSTNAME= \ -e MYSQL_PORT= \ -e MYSQL_ROOT_PASSWORD= \ -v /local/dir:/app/html \ -p 80:80 \ unblibraries/drupal:alpine-nginx-php7-8.x
Other Runtime/Environment Variables
Full documentation of environment variables is available in the wiki.
- unblibraries/drupal is licensed under the MIT License:
- Attribution is not required, but much appreciated:
Drupal Docker Image by UNB Libraries
While running /accessing it first time I am receiving a download option for install.php
Is something wrong with php?
docker run -it \
--name drupal \
-e MYSQL_HOSTNAME=192.168.100.XXX \
-e MYSQL_PORT=3306 \
-e DRUPAL_DB_PASSWORD='XXX' \
-v /docker/data/drupal:/app/html \
-e PUID=33 -e PGID=33 \
-e TZ=Europe/Berlin \
-p 94:80 \