@Abdul : I ran into same issue but the solution you mentioned didn't work for me. Is there anything else that you did, but forgot to capture in your solution here? As per my understanding, the overlay network creates a routing mesh, so doesn't matter which IP you use to access the service on the swarm/cluster, the service will still be hit. I am using a cluster of VMs managed by multipass and orchestrated by Docker Swarm. I have same two containers as your - drupal:9 and postgres:14. When I took the IP (10.199.127.84) and tried to access Drupal using it, i got 'site cant be reached' error. Any idea what I'm missing here?
P.S. Sorry to put it as a response, but I don't have enough 'reputations' to comment on your response/marked-answer.