This repository is for containing source codes of machine learning model server deployment.
You need to have docker
-
clone this repo to your local machine
-
open terminal
-
cd /path/to/ml_model_server_docker_deployment
-
start docker
-
use the following command to build the docker image
docker image build -t docker-iris-ml-server .
- use the following command to see docker images
docker image ls
- use the following command to run ml server
docker run -p 5000:5000 -d docker-iris-ml-server
-
open http://localhost:5000/predict_class in your browser to see get method message
-
open postman and try http://localhost:5000/predict_class for the post method to get model prediction
For example; try the following in your POST request to get machine learning model prediction
{"sepal_length": 5.1, "sepal_width": 3.5,
"petal_length": 1.4, "petal_width": 0.2}
- use the following command to see CONTAINER ID
docker ps
-
copy CONTAINER ID
-
use the following command to stop docker container
docker stop "CONTAINER ID"
- use the following command to free up all the resources that the docker container uses
docker system prune