/streamlit-docker

A docker container for https://streamlit.io - interactive python and machine learning library

Primary LanguagePythonApache License 2.0Apache-2.0

Streamlit on Docker

Project docs: https://streamlit.io/docs/

This Docker image is available on Docker Hub:

Pull

docker pull tomerlevi/streamlit-docker

*Page: https://cloud.docker.com/u/tomerlevi/repository/docker/tomerlevi/streamlit-docker

Running Streamlit docker built-in examples

You can learn how to use streamlit by exploring 3 scripts (packed inside the docker image):

docker run -it -p 8501:8501 tomerlevi/streamlit-docker /examples/intro.py
docker run -it -p 8501:8501 tomerlevi/streamlit-docker /examples/plot_example.py
docker run -it -p 8501:8501 tomerlevi/streamlit-docker /examples/uber_nyc_data_explorer.py

Running your own streamlit script

docker run -it -p 8501:8501 -v <local-scripts-folder>:/app tomerlevi/streamlit <relative-path-to-a-script>

Example: docker run -it -p 8501:8501 -v ~/workspace/streamlit-scripts:/app tomerlevi/streamlit src/main.py

Once streamlit is running, open your browser and navigate to: http://localhost:8501

NOTE: you can open the script you passed (<relative-path-to-a-script>) in your favorite text editor and edit it, streamlit will pickup all changes once you refresh your browser tab.

Build

Clone the repo: git clone git@github.com:MrTomerLevi/streamlit-docker.git

Change dir into the project: cd streamlit-docker

Optional: You can add your required PyPi packages to the requirements.txt

Run docker build: docker build -t tomerlevi/streamlit-docker .