Public | Automated Build

Last pushed: 2 years ago
Short Description
Complete Drupal 6 or Drupal 7 container based on nginx.
Full Description


Container for running Drupal7 based sites


Management scripts:

  • backup
  • restore
  • create-drupal-db
  • create-nginx-site


Starting a container

docker run -d --name mysql -e MYSQL_ROOT_PASSWORD=s3cret \
docker run -d --name drupal7 --link mysql solfisk/drupal7

After this, you need to set up a database for your drupal site:

docker exec drupal7 create-drupal-db \
  s3cret my_drupal_db drupal_login drupal_password

Then download the latest drupal core:

docker exec drupal7 drush dl drupal-7.x \
  --destination=/var/www \
  --drupal-project-rename=drupal7 -y

Now set up your drupal site:

docker exec drupal7 /bin/sh -c 'cd /var/www/drupal7 && drush \
  site-install standard -y \ \
  --account-name=admin \
  --account-pass=admin_s3cret \

Then set up nginx to recognize

docker exec drupal7 create-nginx-site

The first parameter is the main site name (mandatory). The rest specifies optional aliases.


The drupal core must be installed in /var/www/drupal7 - otherwise you'll break the utility scripts.

All state for this container is stored in /var/www/drupal7, so mounting a data container (or host path) here is a very safe way of retaining the state in the event that the container is lost.

Backup and restore

The backups provided by this container contains more than what Drupals backup and migrate contains, because they also contain the site specific nginx configuration, settings, drupal core and all installed modules.

To backup:

docker exec drupal7 backup > drupal7-backup.bin

To restore:

docker exec drupal7 restore < drupal7-backup.bin

Use this in conjunction with docker exec mysql backup and docker exec mysql restore with the Solfisk mariadb-percona image to retain complete backups of the site.


This image uses the nginx configuration for Drupal assembled by António P. P. Almeida.

The rest has been written by Michael Zedeler and Anatolii Romanov.


If you find a bug, you can either:

  • Create an issue describing the symptoms (and if possible, identify the source of the bug and add it to the issue).
  • Fix the bug and open a pull request.


See the license.

Docker Pull Command
Source Repository