Example repo of machine learning model deployment with FastAPI and Docker
This is a minimalistic build, consider to use user auth in a production environment
An article explaining the content of this repo can be found in this medium link
docker build -t iris-ml-build .
docker run -d -p 80:80 --name iris-api iris-ml-build
docker exec -it iris-api pytest --ignore=tests/ --cov=app tests/ --cov-config=.coveragerc
curl -X POST "http://127.0.0.1/v1/iris/predict" -H\
"accept: application/json"\
-H "Content-Type: application/json"\
-d "{\"data\":[[4.8,3,1.4,0.3],[2,1,3.2,1.1]]}"