Learn R Programming

golem (version 0.1)

add_dockerfile: Create a Dockerfile for Shiny App

Description

Build a container containing your Shiny App. add_dockerfile() creates a "classical" Dockerfile, while add_dockerfile_shinyproxy() and add_dockerfile_heroku() creates plateform specific Dockerfile.

Usage

add_dockerfile(input = "DESCRIPTION", output = "Dockerfile",
  pkg = get_golem_wd(), from = paste0("rocker/tidyverse:",
  R.Version()$major, ".", R.Version()$minor), as = NULL, port = 80,
  host = "0.0.0.0")

add_dockerfile_shinyproxy(input = "DESCRIPTION", output = "Dockerfile", pkg = get_golem_wd(), from = paste0("rocker/tidyverse:", R.Version()$major, ".", R.Version()$minor), as = NULL)

add_dockerfile_heroku(input = "DESCRIPTION", output = "Dockerfile", pkg = get_golem_wd(), from = paste0("rocker/tidyverse:", R.Version()$major, ".", R.Version()$minor), as = NULL)

Arguments

input

path to the DESCRIPTION file to use as an input.

output

name of the Dockerfile output.

pkg

Path to the root of the package. Default is ".".

from

The FROM of the Dockerfile. Default is FROM rocker/tidyverse: with R.Version()$major and R.Version()$minor.

as

The AS of the Dockerfile. Default it NULL.

port

The options('shiny.port') on which to run the Shiny App. Default is 80.

host

The options('shiny.host') on which to run the Shiny App. Default is 0.0.0.0.

Examples

Run this code
# NOT RUN {
# Add a standard Dockerfile
if (interactive()){
   add_dockerfile()
}
# Add a Dockerfile for ShinyProxy
if (interactive()){
    add_dockerfile_shinyproxy()
}
# Add a Dockerfile for Heroku
if (interactive()){
    add_dockerfile_heroku()
}
# }

Run the code above in your browser using DataLab