Docker4Drupal is a set of docker containers optimized for Drupal. Use docker-compose.yml file from docker4drupal repository to spin up local environment on Linux, Mac OS X and Windows.
Docker4Drupal is designed to be used for local development, if you're looking for a dev/staging/production solution consistent with Docker4Drupal check out Wodby.
The Drupal bundle consist of the following containers:
|Container||Versions||Service name||Image||Enabled by default|
|PHP||5.3, 5.6, 7.0, 7.1||php||wodby/drupal-php||✓|
|Solr||5.5, 6.3, 6.4||solr||wodby/drupal-solr|
Supported Drupal versions: 6, 7, 8.
- Install Docker (Linux, Docker for Mac or Docker for Windows (10+ Pro))
- For Linux additionally install docker compose
Must know before you start¶
- To make sure you don't lose your MariaDB data DO NOT use
docker-compose down(Docker will destroy volumes), instead use
docker-compose stop. Alternatively, you can specify manual volume for
/var/lib/mysql(see compose file), this way your data will always persist
- To avoid potential problems with permissions between your host and containers please follow this instructions
- For macOS users: Out of box Docker for Mac has poor performance on macOS. However there's a workaround based on docker-sync project, read instructions here
Feel free to adjust volumes and ports in the compose file for your convenience.
- Download docker-compose.yml file from docker4drupal repository and put it to your Drupal project codebase directory. This directory will be mounted to PHP and Nginx containers
- Depending on your Drupal version make sure you're using correct tags (versions) of Nginx and PHP images
- Make sure you have the same database credentials in your settings.php file and MariaDB service definition in the compose file
- Optional: import existing database
- Optional: add additional services (Varnish, Apache Solr, Memcached, Node.js) by uncommenting the corresponding lines in the compose file
- Optional: configure domains
- Run containers:
docker-compose up -d
- That's it! You drupal website should be up and running at http://drupal.docker.localhost:8000
You can stop containers by executing:
We update containers from time to time by releasing new images tags.
This project is licensed under the MIT open source license.