This is my situation.
Docker Containers
1. Node/Play/Any BackEnd Server
2. React
3. Other services
I have launched them using docker-compose and everything works fine. The problem is:
When I launch docker-compose on a VM and serve the UI over an IP it is not able to access the node server.
It happens since the React Code is configured to access the Node server at http://node-backend:9000
(where node-backend
is the name of the docker container that runs nodejs) and react sends this exact URL to the client on some other machine, which cannot resolve this address since http://node-backend:9000
is internal to Docker.
How do I solve this issue without using nginx or any other proxying service?
You should change your configuration of React. Never use the local container name when you want to server over the network.
Here are the steps you need to take