I am creating a docker compose based local project. It has following properties
- It has a frontend created out of nginx web server exposed at port 80, mapped to host port 8080.
- It has backend created out of .NET exposed at port 3000, mapped to host port 8081.
These two are on same network ie TodoApi.
If I do ping backend
from terminal of frontend, all packets are received ie backend is accessible from frontend with in docker network.
But If I try to make a call from frontend index.html to backend using http://backend/get
it fails with host not resolvable which is understandable as backend is only resolvable via Docker DNS.
My understanding it to make frontend talk to backend, when we making browser based calls is via http://hostip:8081
is the only way.
Is this understanding correct? otherwise please enlighten.
Here is link to the mentioned project for referene TodoListApp.