Can't access streamlit in docker

So i was using stream lit library for the web interface and it’s the url that it’s giving me to access the application there are not working

but when i try to bind an ip address along with the port it worked so can anyone help me why this is happening.

docker run -p 192.168.0.8:8502:8502 survival_app. # this one worked

docker run -p 8502:8502 survival_app # this didnt worked so what to do

Hi @4019charan ,

Apparently, it’s a personal lab, so we need additional information. I’m not familiar with streamlit, but apparently he starts the app on port 8501. I don’t know where 8502 is coming from. The port in the container should be 8501.

The right syntax should be :

docker run -p <machine_host_ip_addr>:8501:8501

or

docker run -p 8501:8501

On the first, you’ll access to the app with the link <machine_host_ip_addr>:8501
On the second, you can access with localhost:8501 and <machine_host_ip_addr>:8501

You can use the following image for test purpose mmkmou/streamlit-test

Regard

1 Like