A bare bones project shell for deploying a Streamlit app via Docker, configured with live reloading and other options to facilitate local development (see .streamlit/config.toml
).
Clone the repository and navigate into it:
git clone https://github.com/mwardio/streamlit-docker-shell.git
cd streamlit-docker-shell/
Update src/main.py
with your Streamlit app code and add dependencies to requirements.txt
(optional), then build the Docker image:
docker build . -t streamlit-image
Start the container via Docker Compose (recommended) using the included Compose file (docker-compose.yml):
docker-compose up -d
You can also run the Docker container directly, just be sure to mount the root project directory as a volume labeled /app
(assuming you didn't change the Dockerfile WORKDIR command):
docker run --name streamlit-app -p 8501:8501 -d -v ./:/app streamlit-image