Hi Vikram, I have run two containers on the different web server, Here I have used nginx alpine image only and running it on two containers on the same host machine.
docker run -d -p 8080:80 --name=nginxone nginx:alpine
localhost:8080
and change the port to 8081 to up another container of nginx.
docker run -d -p 8081:80 --name=nginxtwo nginx:alpine
localhost:8081
apart from that, you can create your own network and communication between these two.