Node JS api not accesible from docker image

Viewed 34

I'm working with Node Js, React. The api is created with node js and I have a docker image for that api and also another docker image for react app. Locally is working fine, I can access the node api on the image using http://localhost:4000/ I can make requests from the react app to the api using the url mentioned before. Once I deploy those same images to a Server the node js api is not accesible but if I use curl to test, I get a response from the api. The react app works fine but can't make requests to the API. I already use the IP from the nodejs api image to connect and got no response from the api, also tried links from docker-compose but did no work. Has anyone faced this problem before?

enter image description here

0 Answers
Related