Easy to use Docker container - Streamlit-plus

Greetings-
I built a simple docker container to support my site, partytruths.com and wanted to share. I’ve tried to document as much as possible and it’s very easy to mount your own project folder. Please see the github repo for more details.

I built this as a multi-stage build to try to keep the size down, however it is still ~256MB compressed / 950MB uncompressed. This package includes many dependencies which inflate the size. Some required packages are large such as Pyarrow which is a Streamlit dependency and > 200MB alone. For additional efficiency, you may recompile many of these. The base image is not Alpine so the intrepid optimizer has many available options.

I’m running this successfully on with a simple stack including a Traefik reverse proxy on a free-tier Oracle Cloud instance with 1GB ram and 1 VCPU and it seems to run smoothly, though I haven’t done load testing.

Key packages included:

Viz

  • Streamlit
  • Bokeh
  • Altair
  • Plotly
  • Seaborn
  • Matplotlib

Utils

  • Numpy
  • Pandas
  • SciKitLearn
  • Oauthlib
  • Quandl
  • Pillow
  • Fastcluster
  • Gspread

Enjoy!

3 Likes

Thank you for this bigjoe. Have you posted a copy of your image to Docker Hub by any chance?

1 Like

Yes indeed, it’s available at:

There are two tags, the standard is:
intelligentdesigns/streamlit-plus:latest

and one I built with a bunch of extra tools is at:
intelligentdesigns/streamlit-plus:extra-latest

TODO: Need to push updates to github because I modified the builds a bit then got sidetracked, but here is approx what is included in each; there are surely a couple more
Key packages included:

Streamlit Components

  • streamlit-pandas-profiling
  • streamlit-embedcode
  • streamlit-bokeh-events
  • st-annotated-text

Viz

  • Streamlit
  • Bokeh
  • Altair
  • Plotly
  • Seaborn
  • Matplotlib
  • Plotnine

Utils

  • Numpy
  • Pandas
  • SciKitLearn
  • Oauthlib
  • Quandl
  • Pillow
  • Fastcluster
  • Gspread

Container Tagged “Extra” includes:

  • Pycaret
  • Hiplot
  • Streamlit-vega-lite
  • Streamlit-observable
  • Spacy and Spacy-streamlit
  • Streamlit-folium
  • Facebook Prophet

I will check it out. Thanks!

Greetings to anybody following this thread. I just wanted to send through a notice that I have made some huge updates. Here’s the full README from my github repo:

streamlit-plus

A batteries included docker build including Streamlit + Visualization Tools + Other key tools

For a quickstart, run:

docker run -p 8080:8080 -e STREAMLIT_SERVER_PORT=8080 --restart always intelligentdesigns/streamlit-plus:latest

To run with your own app:
Install Docker Compose

Follow the following

    git clone https://github.com/bigjoedata/streamlit-plus
cd streamlit-plus
nano docker-compose.yml # point the bind mount for /app to your own app folder. As part of the magic of Streamlit, any changes to the folder will be immedialey reflected in your Streamlit
docker build -t .
docker-compose up -d # launch in daemon (background) mode

To build your own, follow the above directions.

nano requirements.txt # Change dependencies as needed. You can also change the requirements_extra.txt or requirements_stbot.txt files for the other versions
nano Dockerfile # Change options if needed. Use Dockerfile_extra or Dockerfile_stbot depending on what you edited above
docker build -f Dockerfile -t streamlit-plus:latest . # Build the Dockerfile you edited above and change tag name similarly

Key packages include:
Streamlit Components

  • streamlit-pandas-profiling
  • streamlit-embedcode
  • streamlit-bokeh-events
  • st-annotated-text

Viz

  • Streamlit
  • Bokeh
  • Altair
  • Plotly
  • Seaborn
  • Matplotlib
  • Plotnine

Utils

  • Numpy
  • Pandas
  • SciKitLearn
  • Oauthlib
  • Quandl
  • Pillow
  • Fastcluster
  • Gspread
  • Pandas Profiling & streamlit-pandas-profiling
  • streamlit-embedcode

The Container Tagged “Extra” includes:

  • Pycaret
  • Hiplot
  • Streamlit-vega-lite
  • Streamlit-observable
  • Spacy & Spacy-streamlit
  • Streamlit-folium
  • Facebook Prophet

The Container Tagged “stbot” only includes:

And more. See requirements for versions and full list of included packages.

Note: I have built this as a multi-stage build to try to keep the size down, however it is still ~256MB compressed / 950MB uncompressed. This package includes many dependencies which inflate the size. You can roll your own by editing the requirements.txt and rebuilding, but some required packages are large such as Pyarrow which is a Streamlit dependency and > 200MB alone.

2 Likes