Dockerised Drupal 8 development environment using Ubuntu 14.04. This image is a development companion to the docker-drupal-ubuntu14.04 project.
- Drupal Console - execute Drupal
- Drupal Coder - defines Drupal coding standards.
- Drupal Strict - defines strict Drupal and PHP coding standards.
- PHP Code Sniffer - detect violations of coding standards.
- PHP Mess Detector (PHPMD) - discover possible bugs and suboptimal code.
- PHP Copy/Paste Detector (PHPCPD) - detect copy/pasted code.
- PHP Dead Code Detector (PHPDCD) - discover unused PHP code.
- PHP Lines of Code (PHPLoC) - measuring the size of a project.
- PHP Depend (PHPMD) - generate design quality metrics.
- PHPUnit - unit testing PHP code.
- DoxyGen - generate documentation from annotated PHP code. It is used to generate XML which is then interpreted by Sphinx.
- Sphinx - generate beautiful Read The Docs format using Breathe as a bridge to DoxyGen XML output.
# Build database image based off MySQL 5.5
sudo docker run -d --name mysql-drupal8-ubuntu14-dev mysql:5.5 --entrypoint /bin/echo MySQL data-only container for Drupal 8 Dev MySQL
# Clone Drupal base docker repository
git clone https://github.com/andrewholgate/docker-drupal8-ubuntu14.04.git
# Build docker image
cd docker-drupal8-ubuntu14.04
sudo docker build --rm=true --tag="drupal8-ubuntu14.04" . | tee ./build.log
# Clone Drupal development docker repository
git clone https://github.com/andrewholgate/docker-drupal8-ubuntu14.04-dev.git
cd docker-drupal8-ubuntu14.04-dev
# Customise docker-compose.yml configurations for environment.
cp docker-compose.yml.dist docker-compose.yml
vim docker-compose.yml
# Build docker image
sudo docker build --rm=true --tag="drupal8-ubuntu14.04-dev" . | tee ./build.log
# Build docker containers using Docker Composer.
sudo docker-compose build
sudo docker-compose up -d
From the host server, add the web container IP address to the hosts file.
# Add IP address to hosts file.
sudo bash -c "echo $(sudo docker inspect -f '{{ .NetworkSettings.IPAddress }}' \
dockerdrupal8ubuntu1404dev_drupal8ubuntu14devweb_1) \
drupal8dev.example.com \
>> /etc/hosts"
# Using the container name of the web frontend.
sudo docker exec -it dockerdrupal8ubuntu1404dev_drupal8ubuntu14devweb_1 su - ubuntu