2. Swarm mode

Make this server a manager node:

docker swarm init

Create a network for the common services:

docker network create -d overlay instance01

Create the local folders to hold the service data:

mkdir /mysql01 /joomla01

Start the mysql service:

docker service create          \
  --name mysql01               \
  --network instance01         \
  -e MYSQL_USER=joomla         \
  -e MYSQL_PASSWORD=joomla     \
  -e MYSQL_DATABASE=joomla     \
  -e MYSQL_ROOT_PASSWORD=mysql \
  --mount type=bind,target=/var/lib/mysql,source=/mysql01 \
  mysql:5.7.13
    

Start the joomla service:

docker service create          \
  --name joomla01              \
  --network instance01         \
  -p 8080:80                   \
  -e JOOMLA_DB_HOST=mysql01    \
  -e JOOMLA_DB_NAME=joomla     \
  -e JOOMLA_DB_USER=joomla     \
  -e JOOMLA_DB_PASSWORD=joomla \
  --mount type=bind,target=/var/www/html,source=/joomla01 \
  joomla:3.5.1-apache-php7
    

Install joomla via the web installer, then scale it:

docker service scale joomla01=5

Delete the services:

docker service rm mysql01 joomla01
docker network rm instance01
docker swarm leave --force