This Repository contains simple examples of Machine Learning Services with Flask as REST API.
Before running the services, we need to setup environments that saved to .env
file.
cp .env.example .env
Adjust the environments, then
Install dependencies
pipenv install --skip-lock
Run Flask APP
pipenv run python api.py
Build Docker Image
docker build -t repodevs/ml-service .
Run Containers
docker run -d --name ml-app -p 5001:5001 repodevs/ml-service
Testing the Services
http POST http://0.0.0.0:5001/ml-titanic/v1/predict "Pclass:=[1]" 'Sex:=["male"]' "Age:=[32]" "SibSp:=[1]" "Parch:=[0]" "Fare:=[100]" 'Embarked:=["S"]' -v