How aps31012005-prog/task_9_docker_fundamentals_and_container_lifecycle_management works
This repository combines a Streamlit image-classification interface with a Flask prediction API and a Dockerized deployment. The principal workflow is image upload, HTTP transfer, CIFAR-10 preprocessing and inference, then displaying the returned class and confidence. The README also documents container lifecycle and networking; deployment links reflect that documentation, while unshown Docker internals are omitted.
Main entry points: 1_Image_Prediction.py Prediction page · flask_api.py Prediction endpoint · cifar10_cnn.keras CNN classifier · app.py Model overview
Components 16
Streamlit interface
- Model overview
app.py - Prediction page
pages/1_Image_Prediction.py - Image preview
pages/1_Image_Prediction.py - API status check
pages/1_Image_Prediction.py
Prediction API
- Flask API
flask_api.py - Health endpoint
flask_api.py - Prediction endpoint
flask_api.py - Image preprocessing
flask_api.py - CNN classifier
model/cifar10_cnn.keras - Class mapping
flask_api.py - Prediction result
flask_api.py
Container runtime
- Docker Engine
- Container definition
Dockerfile - Running container
Other components
- Image uploader
- Docker CLI
Connections 18
- Image uploader → Prediction page: uploads image
- Prediction page → Image preview: displays image
- Prediction page → API status check: checks status
- API status check → Flask API: GET request
- Flask API → Health endpoint: dispatches
- Prediction page → Prediction endpoint: POSTs image
- Flask API → Prediction endpoint: dispatches
- Prediction endpoint → Image preprocessing: preprocesses image
- Prediction endpoint → CNN classifier: runs inference
- Prediction endpoint → Class mapping: maps class index
- Prediction endpoint → Prediction result: returns JSON
- Prediction page → Prediction result: receives JSON
- Prediction page → Image uploader: shows result
- Model overview → CNN classifier: loads model
- Docker CLI → Docker Engine: manages containers
- Container definition → Running container: configures runtime
- Docker Engine → Running container: runs image
- Running container → Flask API: hosts API