I have a dockerized node app running inside a container on an ubuntu-vm-host with static address, but can only reach it through localhost. I use the command: sudo docker run -d -p 49160:3000 8a5ccd9f4cca to start the app. I can reach running node servers on the vm without any trouble when they are run in the vm without docker. When i curl http://localhost:49160/test i get a response. but if i try to change it to curl http://"correct ip address":49160/test it doesnt work.
The forwarding port shows up when i netstat -l inside the ubuntu-vm-host. If i do:
curl http://172.17.0.1:49160/test
which is the docker0 network interface inet address, it gets through.
Sorry for the previous irresponsible answer. To debug the issue
UPDATED
First to see if the app is running correctly try,
docker logs <container id>
if all the console out put that you usually print out is there,
Scenario 1 : If it is not, run the docker using the -it flag instead of -d manually start the process and check with a curl to debug.
docker run -it -p 49160:3000 <image id> /bin/bash
Scenario 2 : If it is running, check if the internal ubuntu firewall is enabled using the following, if so if you don't need it disable it.
sudo ufw status
to disable : sudo ufw disable
to allow : sudo ufw allow 49160