Getting getaddrinfo ENOTFOUND <instance-id> only when deployed


I have two apps running in one Pantaris project. when I try calling the other app api from one app.
It is throwing getaddrinfo ENOTFOUND

Note: Its perfectly working in local


in general two apps cannot communicate with each other backend internally.
You might be able to work around this, by whitelisting the app (url with instanceId) in the docker-compose.yaml and call it like an external url.

In which app docker compose I need to do this? web app or api app?

these two apps are not deployed in multi container. they are in different hosts.