Skip to contents

Create Docker configuration for a Shiny application

Usage

dockerize(
  app_dir,
  output_dir = NULL,
  app_type = NULL,
  port = 3838,
  dependencies = TRUE,
  custom_dockerfile = NULL,
  env_vars = NULL,
  ...
)

Arguments

app_dir

Character. Path to the Shiny application directory.

output_dir

Character. Path where Docker configuration should be created. If NULL, files will be created in app_dir.

app_type

Character. Either "r" or "python". If NULL, it will be auto-detected.

port

Integer. The port to expose for the Shiny application. Default: 3838.

dependencies

Logical. Whether to automatically detect and include dependencies. Default: TRUE.

custom_dockerfile

Character. Path to a custom Dockerfile template to use. If NULL, the package's built-in templates will be used.

env_vars

Named character vector. Environment variables to include in the Docker configuration.

...

Additional arguments passed to internal functions.

Value

Invisibly returns the path to the created Docker configuration.

Examples

if (FALSE) { # \dontrun{
# Basic usage with an R Shiny app
dockerize("path/to/my/shinyapp")

# For a Python Shiny app
dockerize("path/to/my/python/shinyapp", app_type = "python")

# With custom port and environment variables
dockerize("path/to/my/shinyapp", port = 8080,
          env_vars = c(API_KEY = "your-secret-key"))
} # }