in this tutorial, we will use NGINX as a web server for load balancing configuration when containers are triggered
2) properties required to be configured when launching the proxy container
- we need to bind the container to 80 by -p 80:80 command
- we should mount the file called docker.sock file by using
**-v /var/run/docker.sock:/tmp/docker.sock:ro.**We specify :ro to restrict access to read-only.
- to run multiple websites on a single machine we have to set a hostname
3)we will use NGINX proxy as example
here we are using DEFAULT HOST any requests which come are redirected to the default container
VIRTUAL_HOST environment variable. This variable defines the domain where requests will come from and should be handled by the container.
so we launch the second container now the first request goes to the first container and the second request goes to the second container
the default Nginx configuration is generated inside the Nginx container
to check the logs for load balancing