This repository contains a simple implementation of a Flask app serving a machine learning model as JSON REST API.
The deployment uses CherryPy as WSGI server implementation. The project contains also a Dockerfile to create a containerized version of the application. The image is based on a Debian:latest-slim base image and once built, is around 120 MB (thanks to Michele Bologna for the suggestions).
Just type ./start-server.sh
.
First build the Docker image and then run it.
docker build -t pyml_img .
docker run --name pyml_instance -p 5000:5000 -i -t pyml_img
- DigitalOcean guide on how to containerize Python web applications.