This piece of code will be launching two services, one for joomla and another one for the database named joomladb. The links: part specifies that the service will be connecting to the joomladb:mysql service.





The image is telling docker to pull the joomla image from the docker hub. This image is basically a small linux server with apache and a fresh install of joomla.





The "ports" section defines that docker shall reroute the port 80 from the application to the port 8080 of the hosting machine (in this case , your laptop / PC). With ports you open the connections via that port from all machines. So watch out because in our example we are opening the port 3306 for everyone to listen to.





I like to do this in development mode so I can access the database using other sql explorers like Navicat SQL. It just makes everything so much more comfortable. Without this directive, then only the joomla server will be able to connect to the joomladb mysql service.





Containers for the linked service are reachable at a hostname identical to the alias, or the service name if no alias was specified.





"Volumes" is mounting one route from the hosting machine to the route specified into the container. In this case, we will be re-routing our parent folder (which will become our project folder) to the /var/www/html where apache stores its website files.





As you can also see, we do the same thing for the joomladb service, so we save the database files inside of our own folder (this way , we can carry all of our website in one single folder and fire it up with a simple docker command).





"Environment" tags system environment variables for the containers and it's pretty self intuitive.





now navigate via your command line interface to the ops folder and run the command:



docker-compose up





And you will see how in console the joomla database image and the joomla php/apache server are fired up. You now have two docker instances running. If you run the command docker service ls you will see them listed. We will talk about how to run this service in a swarm mode later in this tutorial.