API-SIMPLE-DEMO

Simple API that train and predict on a model for Iris dataset.

In production

https://api-demo-becode.herokuapp.com/

Folder architecture

-
-- README.md
-- App.py
-- Training
---- training.py
-- Models
---- Model.pickle

Application features

Routes

  • / -> alive
  • /train -> Train the model and save it
  • /predict -> Return a prediction

Docker informations

Build

docker build -t api-demo .

Run

With volumes:

docker run -v $PWD:/app -p 5000:5000 -it api-demo bash

Without:

docker run -p 5000:5000 -it api-demo bash

Without interactive mode:

docker run -p 5000:5000 -t api-demo

VScode extension

  • Remote container
  • Docker