Just try to deploy a simple ML model like Iris classification
Here are the steps to run your Flask app with Docker on a new PC and connect to it with HTML:
- Install Docker
- Clone the project repository:
git clone <repository-url>
- Build the Docker image: create new project for that. Open terminal > command prompt >
docker build -t <image-name>
- Run the Docker container
docker run -p 5000:5000 <image-name>
- Open the
templates/index.html
file
If you want to connect port 8000 in local host to port 5000 in container
- Run the Docker container
docker run -p 8000:5000 <image-name>
- Change the file
templates/index.html
to
fetch('http://localhost:8000/predict', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},