Simple docker streamlit template app to be run on DigitalOcean app platform.
After cloning this repository, you need to set up a soft link to the app folder from a sister repository:
-
Clone the nf_streamlit repository in the same parent directory:
cd .. git clone <nf_streamlit_repo_url> nf_streamlit cd docker_streamlit
-
Create the soft link to point to the app folder:
ln -s ../nf_streamlit/app/ app
-
Verify the setup - your directory should look like this:
ls -la # Should show: app -> ../nf_streamlit/app/
The final directory structure should be:
docker_streamlit/
├── .git/
├── .do/
├── Dockerfile
├── LICENSE
├── README.md
├── run_nfstreamlit.sh
└── app -> ../nf_streamlit/app/ (soft link)
Important: The nf_streamlit/app/ directory contains the live data folder and should be mounted as a volume when running the container to ensure the application has access to current data.
To deploy you first need to click on "Use this template" and then simply log into your Digital Ocean account and click on "Apps" -> "Launch Your App" -> "Github" and select the corresponding Github repository.
You can use my referral link to get $100 worth of credit over 60 days.
To run locally, try:
# Copy requirements.txt from the soft link (Docker can't follow symlinks during build)
cp app/requirements.txt requirements.txt
# Build the Docker image
docker build . -t streamlit_app
# Run the container with the soft-linked app folder mounted
docker run -p 8501:8501 -v ~/docker_streamlit/app:/app streamlit_appFor production deployment, use the included launch script run_nfstreamlit.sh:
# Make the script executable
chmod +x run_nfstreamlit.sh
# Run the container in the background with live data volume
./run_nfstreamlit.shThis script:
- Runs the container in the background using
nohup - Mounts the live data folder from
~/nf_streamlit/appto/appin the container - Ensures the application has access to current data files
Tips for the running updates on the server
git fetch origin
git merge --ff origin main
# Copy requirements.txt from the soft link
cp app/requirements.txt requirements.txt
docker build . -t streamlit_app
docker run -p 8501:8501 -v ~/docker_streamlit/app:/app streamlit_appImportant Note for Production Deployment: The Dockerfile automatically installs requirements from the soft-linked app folder during build. For DigitalOcean App Platform deployment, ensure the soft link is properly set up before building, or use the production launch script for local deployment with live data access.