The goal of golem4bench is to provide a golem skeleton for benchmarking deployment strategies.
See:
Testing is done by variation of run_app( "runApp" ) / run_app( "shinyApp" ) / run_app( "shinyAppDir" )
dev/run_dev.R# Set options here
options(golem.pkg.name = "aaaa") # TRUE = production mode, FALSE = development mode
options( "golem.pkg.name" = "aaa")
# Detach all loaded packages and clean your environment
golem::detach_all_attached()
# rm(list=ls(all.names = TRUE))
# Document and reload your package
golem::document_and_reload()
# Run the application
aaaa::run_app(with = "runApp")
Using inst/dockerfilelocal
R -e "devtools::build(path = 'inst/dockerfilelocal/')" \
&& cd inst/dockerfilelocal/ \
&& docker build -t aaa . \
&& docker run --name aaaa -p 1234:1234 -d aaa \
&& sleep 2 \
&& open http://0.0.0.0:1234
Use the app.R file at the root of the packages
Local Shiny Server is built with:
mv inst/dockerfileshinyserver/Dockerfile Dockerfile \
&& docker build -t plop . \
&& docker run --name plop -p 3838:3838 -d plop \
&& sleep 2 \
&& open http://0.0.0.0:3838/aaaa
App can be sent to shinyappio and Connect with:
rsconnect::deployApp()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.