A lightweight Streamlit-based web application, packaged as a Docker image, designed to demonstrate Persistent Volume (PV) and Persistent Volume Claim (PVC) concepts in Docker/Kubernetes.
This app allows users to:
The repository image is available on Docker Hub and is intentionally kept small, simple, and practical for DevOps & Kubernetes learning useβcases.
This Docker image runs a Streamlit web server that:
png, jpg, jpeg)/photos directoryπ‘ Core learning objective:
Demonstrate how application data can be persisted using volumes (PV/PVC) instead of being lost when containers restart.
In real-world Kubernetes:
This app makes that concept visually clear:
/photosPerfect for:
upload-app/
βββ manifests/ # (Optional) Kubernetes YAMLs (PV, PVC, Deployment)
βββ photos/ # Runtime directory where images are stored
βββ Dockerfile # Container build instructions
βββ main.py # Streamlit application code
βββ requirements.txt # Python dependencies
βββ pyproject.toml # Project metadata (modern Python standard)
βββ uv.lock # Dependency lock file
βββ README.md # Documentation
βββ .python-version # Python version pin (3.11)
photos/This is the MOST IMPORTANT directory.
python:3.11-slim
8501
(Default Streamlit port)
FROM python:3.11-slim
β Minimal Python image
WORKDIR /app
β All app files live here
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
β Dependency installation
COPY . .
β Copy application code
EXPOSE 8501
β Streamlit UI port
CMD ["streamlit", "run", "main.py", "--server.port=8501", "--server.address=0.0.0.0"]
β Starts Streamlit server
docker pull riteshatri/upload-app:latest
docker run -d \
-p 8501:8501 \
--name upload-app \
riteshatri/upload-app:latest
β Restart container β images gone
docker volume create photos-data
docker run -d \
-p 8501:8501 \
-v photos-data:/app/photos \
--name upload-app \
riteshatri/upload-app:latest
β Restart container β images stay
| App Path | Kubernetes Resource |
|---|---|
/app/photos | PersistentVolumeClaim |
volumeMounts:
- name: photos-volume
mountPath: /app/photos
Now:
png, jpg, jpegPHOTOS_DIR = Path("photos")
PHOTOS_DIR.mkdir(exist_ok=True)
β Directory auto-created
From requirements.txt:
streamlit
pillow
| Package | Purpose |
|---|---|
| Streamlit | Web UI framework |
| Pillow | Image processing |
β
Docker learners
β
Kubernetes beginners
β
PV/PVC explanation
β
Interview demos
β
DevOps labs
A minimal Streamlit app Docker image designed to visually and practically demonstrate persistent storage using Docker volumes and Kubernetes PV/PVC.
Ritesh Sharma
DevOps | Docker | Kubernetes | Azure
β If you are learning containers & Kubernetes β this image is made exactly for you.
Content type
Image
Digest
sha256:f7e7e6a13β¦
Size
168.6 MB
Last updated
9 months ago
docker pull riteshatri/upload-app