Docker network and swarm service access

Hello, there

I am in need for an advise or a direction.
I am running some application, that needs to access elasticsearch on the backend and to be accessed from outside using HTTPS.
Both the application and ES are running as docker service.

I created an overlay network and used “dnsrr” so the resolving part is fine.
Next i created a service for each one of the components, however the situation is that the whole thing work if i have only one of each containers. When i start to scale, the application tries to access the ES cluster and throws errors, The same goes to accessing the App from outside - it seems to be because of round robin. The HTTPS fails, and so the flow with es.

I thought about using reverse proxy, but could it solve the issue and how should it be configured?

Thank you very much in advance,