Application doesn't open on network and external url

When running a container, it doesn’t show anything on the address given.

FROM python:3.8
COPY . /app
EXPOSE 8501
WORKDIR /app
RUN apt-get update
&& \ apt-get install ffmpeg libsm6 libxext6 -y
RUN pip3 install --upgrade pip
RUN pip3 install -r requirements.txt
CMD streamlit run age_gender_prediction.py

This is the docker file. I am running the command

docker run -t -p 8501:8501 age_gender:1.0

It gives the output as

You can now view your Streamlit app in your browser.
Network URL: http://172.17.0.2:8501
External URL: http://103.41.26.105:8501

But the addresses show nothing. Any help is appreciated

When I open localhost:8501, the application works fine.

Hi @Dhruv_Vashist, welcome to the Streamlit community!

The behavior you are seeing is expected, in that the URL you are seeing is relative to the Docker container it’s running in. From a Streamlit perspective, the app can’t see outside of the container, so it tells you where it’s running on the container

While it’s a confusing message, it’s one of those things that we can’t really change on our side, due to how containers work.

Best,
Randy

Hi. I don’t understand this, I also did the same as @Dhruv_Vashist . I deployed my Streamlit app using docker, and when I run the container on a GCP VM where I did the docker build, it displays a network url and external url but when I try opening the external url, it doesn’t load. It doesn’t seem to be a firewall issue either.
What should I do if I want to use my external url to share the app with others outside my local network.
Please help.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.