How do I access a python flask app running in a container on localhost?

I followed this tutorial on how to build a flask app that runs in docker that can be accessed on localhost and the instructions for building Docker are incorrect because after starting the app, when I visit localhost:6000 there is nothing listening there.

My question is, how do I access the flask app in the Docker container on local host?


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi there @sebobill,

I would recommend running the following command:

  1. docker ps -a

This will show you all of your containers, that way you will be able to see if your container is actually running.

Also if the container is running you will see the port that the container is bound on and try to access it on that specific port.

If the container is not running or if you are still getting the error I would recommend checking your container logs with the following command:

  1. docker logs CONTAINER_ID

Feel free to share the output of the two commands here so that I could try to further advise you.

Regards, Bobby