Deploy a web cluster from two docker machines using a single bash script [closed]

Tell me, please, how to solve this problem from the leadership?

  • Containerization Environment: Docker 19.x
  • Operating System: Linux(Ubuntu)
  • Balancer: HAProxy -any
  • Web Server: Nginx – any

Write a bash script that in an existing Docker containerization environment:

    1. Create and launch two docker-images of the Linux operating system.
    2. Install a HAProxy balancer and a Nginx web server in each of the images
    3. Configure the balancers so that the traffic goes to one of the available Nginx web servers.

    4. After launching the docker-images of the operating system (Ubuntu), the Bash script should check the availability of Nginx web
      servers using the ports of the HAProxy balancers.

Thank!

Source: StackOverflow