dockerfiles: Create a Dockerfile for your App

Description Usage Arguments Value Examples

Description

Build a container containing your Shiny App. add_dockerfile() creates a generic Dockerfile, while add_dockerfile_shinyproxy() and add_dockerfile_heroku() creates platform specific Dockerfile.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
add_dockerfile(
  path = "DESCRIPTION",
  output = "Dockerfile",
  pkg = get_golem_wd(),
  from = paste0("rocker/r-ver:", R.Version()$major, ".", R.Version()$minor),
  as = NULL,
  port = 80,
  host = "0.0.0.0",
  sysreqs = TRUE,
  repos = c(CRAN = "https://cran.rstudio.com/"),
  expand = FALSE,
  open = TRUE,
  update_tar_gz = TRUE,
  build_golem_from_source = TRUE,
  extra_sysreqs = NULL
)

add_dockerfile_shinyproxy(
  path = "DESCRIPTION",
  output = "Dockerfile",
  pkg = get_golem_wd(),
  from = paste0("rocker/r-ver:", R.Version()$major, ".", R.Version()$minor),
  as = NULL,
  sysreqs = TRUE,
  repos = c(CRAN = "https://cran.rstudio.com/"),
  expand = FALSE,
  open = TRUE,
  update_tar_gz = TRUE,
  build_golem_from_source = TRUE,
  extra_sysreqs = NULL
)

add_dockerfile_heroku(
  path = "DESCRIPTION",
  output = "Dockerfile",
  pkg = get_golem_wd(),
  from = paste0("rocker/r-ver:", R.Version()$major, ".", R.Version()$minor),
  as = NULL,
  sysreqs = TRUE,
  repos = c(CRAN = "https://cran.rstudio.com/"),
  expand = FALSE,
  open = TRUE,
  update_tar_gz = TRUE,
  build_golem_from_source = TRUE,
  extra_sysreqs = NULL
)

Arguments

path

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 get_golem_wd().

from

The FROM of the Dockerfile. Default is FROM rocker/r-ver:R.Version()$major.R.Version()$minor.

as

The AS of the Dockerfile. Default it NULL.

port

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

host

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

sysreqs

boolean. If TRUE, the Dockerfile will contain sysreq installation.

repos

character. The URL(s) of the repositories to use for options("repos").

expand

boolean. If TRUE each system requirement will have its own RUN line.

open

boolean. Should the Dockerfile be open after creation? Default is TRUE.

update_tar_gz

boolean. If TRUE and build_golem_from_source is also TRUE, an updated tar.gz is created.

build_golem_from_source

boolean. If TRUE no tar.gz is created and the Dockerfile directly mount the source folder.

extra_sysreqs

character vector. Extra debian system requirements. Will be installed with apt-get install.

Value

The {dockerfiler} object, invisibly.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# 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()
}

golem documentation built on April 17, 2021, 9:06 a.m.