I am running a flask application inside a docker container. I would like to access the containers port 8000
* Running on http://127.0.0.1:8000/
from my host machine.
I am running the docker container via
docker run -p 127.0.0.1:8080:8000 --rm $(IMAGE_NAME) /Stocks/startserver.sh
When I do docker ps
I see the following text
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
85168e4c963e stocks "/Stocks/startserver…" 12 seconds ago Up 11 seconds 127.0.0.1:8080->8000/tcp beautiful_bartik
When I open localhost:8080 on my local machine I see nothing. From my understanding the port is open, any idea why I am not able to connect to it from my host machine? Any tips on how to debug a solution for this?