2 server 2 node each architecture for elastic not working

Also, check this similar question here.

If I'm not wrong in this scenario you need to set docker to use network-moder as host.

And you will probably need to set network.publish_host to the ip of your docker host specific for each container.