this past two day I\'m having trouble with docker and i can get it. Following to the docker doc you can expose the ports on which a container will listen for connections wi
In your nodejs app, you have the instruction app.listen(PORT);
which tells nodejs to start a server listening for connections on the loopback interface on port PORT
.
As a result your app will only by able to see connections originating from localhost (the container itself).
You need to tell your app to listen on all interfaces on port PORT
:
app.listen(PORT, "0.0.0.0");
This way it will see the connections originating from outside your Docker container.