Docker container doesn't resolve hostname from another docker container in same network

2020-02-14 angular docker nginx containers

I have created 2 containers.

The first one is a nginx server with name angular_simple_crud_app which is running an angular project

The other one is a json-server with name fake_server, in order to produce data to the first container.

Furthermore, I have created also a bridge network called isolated_network in order to allow the containers to communicate throughout container name

I face a problem with the first container, because when i open a browser the nginx cannot resolve the container name of the json-server.

enter image description here

But when i exec in nginx container and execute a curl to the json-server i get the correct results.

enter image description here

Do you have any suggestions?

if you want to run the app, execute the file