Skip to content

Instantly share code, notes, and snippets.

View collinprather's full-sized avatar

Collin Prather collinprather

View GitHub Profile
├── app.py # streamlit code
├── content.py # textual content - imported into app
├── images # various images for your app
│   ├── logo.png
│   ├── background.png
├── requirements.txt # libraries used by your app
FROM ubuntu:18.04
# base image
# a little overkill but need it to install dot cli for dtreeviz
FROM ubuntu:18.04
# ubuntu installing - python, pip, graphviz
RUN apt-get update &&\
apt-get install python3.7 -y &&\
apt-get install python3-pip -y &&\
apt-get install graphviz -y
RUN apt-get update &&\
apt-get install python3.7 -y &&\
apt-get install python3-pip -y &&\
apt-get install graphviz -y
EXPOSE 8501
WORKDIR /streamlit-docker
COPY requirements.txt ./requirements.txt
RUN pip3 install -r requirements.txt
COPY . .
CMD streamlit run app.py
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8
RUN mkdir -p /root/.streamlit
RUN bash -c 'echo -e "\
[general]\n\
email = \"\"\n\
" > /root/.streamlit/credentials.toml'
RUN bash -c 'echo -e "\
[server]\n\
enableCORS = false\n\
docker image build -t streamlit:app .
$ docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
streamlit app ecda3493de33 50 seconds ago 1.52GB