net::ERR_CONNECTION_REFUSED

In MERN application using multi container I receive I am now trying with Docker Compose. Without docker container the application is working fine but with docker compose when the front end calls the API of backend I received net::ERR_CONNECTION_REFUSED

How do you connect from one container to another? You can’t use localhost, rather use Docker service names, for which Docker provides internal DNS resolution.

Maybe share your docker-compose.yml.

1 Like