Docker Community Forums

Share and learn in the Docker community.

Container send post request to another container

I have 2 containers on the same network. The first Container has port 3000 exposed and is the UI. When it communicates with the api on another container, nothing happens. Nothing is returned.

If i were to access the api from the exposed external port 4000, it works.

I want the containers to communicate on the same network.

If i inspect the network request from the browser:

Request URL:http://172.21.0.4/api/v1.0/Token/AuthenticateByUsernamePassword/mjs/letmein

Request method:OPTIONS

Referrer Policy:no-referrer-when-downgrade

I have tried replacing the ip address with the container name, still nothing. This would only work if i change the ip address to localhost:4000

Can anyone help or point me in the right direction?

Thanks

Could this be a cors issue