Heres my Dockerfile
FROM ubuntu:bionic
RUN apt-get update
RUN apt-get install -y software-properties-common
RUN apt -y upgrade
RUN apt-get update \
&& apt-get install -y python3-pip python3-dev \
&& cd /usr/local/bin \
&& ln -s /usr/bin/python3 python \
&& pip3 install --upgrade pip
EXPOSE 8501
RUN pip3 install streamlit
So when I run a simple app to print hello world I get this response:
root@53c32fbe61b0:~/ajinkya# streamlit run myapp.py
You can now view your Streamlit app in your browser.
Network URL: http://172.17.0.2:8501
External URL: http://122.170.65.6:8501
The app runs on network URL but not on External URL.
To debug the issue I got to know that inside ~/.streamlit/config.toml file I have to set enableCORS=false. But this didn’t work, I noticed I don’t have
~/.streamlit/config.toml
file in this location so I created a folder in root directory and named it “streamlit” and then manually created a file named config.toml. the complete path to config.toml is
cd ~/streamlit/config.toml
Inside this newly created config.toml I changed this parameter: enableCORS=false
but still the app won’t work on external URL.
It works only on local host. What am I missing?