vetiver_write_docker: Write a Dockerfile for a vetiver model

Description Usage Arguments Value Examples

View source: R/write-docker.R

Description

After creating a Plumber file with vetiver_write_plumber(), use vetiver_write_docker() to create a Dockerfile plus an renv.lock file for a pinned vetiver_model().

Usage

1
vetiver_write_docker(vetiver_model, plumber_file = "plumber.R", path = ".")

Arguments

vetiver_model

A deployable vetiver_model() object

plumber_file

A path for your Plumber file, created via vetiver_write_plumber(). Defaults to plumber.R in the working directory.

path

A path to write the Dockerfile and renv.lock lockfile, capturing the model's package dependencies. Defaults to the working directory.

Value

The content of the Dockerfile, invisibly.

Examples

1
2
3
4
5
6
7
8
library(pins)
tmp_plumber <- tempfile()
b <- board_temp(versioned = TRUE)
cars_lm <- lm(mpg ~ ., data = mtcars)
v <- vetiver_model(cars_lm, "cars_linear")
vetiver_pin_write(b, v)
vetiver_write_plumber(b, "cars_linear", file = tmp_plumber)
vetiver_write_docker(v, tmp_plumber, tempdir())

tidymodels/vetiver documentation built on Jan. 14, 2022, 7:32 p.m.