Convert a tundraContainer into a dockerized REST server.
HTTP request | endpoint | response |
---|---|---|
GET/POST | / | "OK" |
GET/POST | /ping | "pong" |
GET/POST | /predict (with JSON payload) | serialized output of predict as JSON |
You can customize both your server script and your dockerfile if you need additional functionality.
model <- readRDS("path/to/model/object")
build_image(model, "kirillseva/mySuperGlmModel") # use docker hub, default options
build_image(model, "kirillseva/veryCustomized", "myregistry.com",
"path/to/dockerfile", "path/to/server/script") # custom registry and configs
By default, the server will listen on port 8103. You can run it as following:
docker run -p 8103:8103 kirillseva/mySuperGlmModel