/docker-drupal8-ubuntu14.04-dev

A dockerised Drupal 8 development image using Ubuntu 14.04, inheriting configurations from https://github.com/andrewholgate/docker-drupal8-ubuntu14.04

About

Dockerised Drupal 8 development environment using Ubuntu 14.04. This image is a development companion to the docker-drupal-ubuntu14.04 project.

Included Tools

Debugging Tools

  • XDebug - PHP debugging and profiling.
  • XHProf - function-level hierarchical profiler.

Development tools

Code Inspection Tools

PHP Documentation Tools

  • 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.

Installation

Create Presistant Database data-only container

# 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

Build Drupal Base Image

# 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

Build Project Development Image

# 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 Project using Docker Compose

# Build docker containers using Docker Composer.
sudo docker-compose build
sudo docker-compose up -d

Host Access

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"

Logging into Web Front-end

# Using the container name of the web frontend.
sudo docker exec -it dockerdrupal8ubuntu1404dev_drupal8ubuntu14devweb_1 su - ubuntu