How it works...
In step 1, we modified the existing docker-compose.yml to add a load balancer and network configurations for our application. We should note that the load balancer we are using here is a container build from an image fetched from Docker Hub, which looks for a Docker engine socket and load balances the traffic between containers linked on the same network.
In step 2, we used an existing task from the recipe Using Docker Compose to manage a service to rebuild our application using docker-compose.yml.
In step 3, we defined a task for scaling out a web service using the Ansible module docker_service and the parameter scale with its values defined as name of service and count of containers to scale out.
In step 4, we verified if ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access