在闪亮的服务器上部署打包闪亮的应用程序

Deploy packaged shiny app on shiny server

当为 shiny 服务器设置这样的 shiny 应用程序时

+---/srv/shiny-server
|   +---shinyApp1
|       +---server.R
|       +---ui.R

一切正常。但是,当上述文件 (ui.Rserver.R) 包含在 packages inst/shiny 文件夹中时,我该如何做呢? (例如,参见我的 gridsampler 存储库)。

如何在 shiny 服务器上部署打包的 shiny 应用程序?

我采用了简单的方法,只是将包从 GitHub 克隆到 shiny-server 目录中,并且必须手动 link 到 inst/shiny 子目录,请参阅 my hosted version of gridsampler as an example (notice the non-pretty URL). The shiny-server is set up to host a directory of apps, hence the overview when visiting the root URL 您需要点击进入应用程序的位置。

其他可能性可能包括将存储库克隆到 shiny-server 文件夹之外的某个位置,然后将 inst/shiny 文件夹作为 gridsampler symlinking 到 shiny-server 文件夹中,afaik 应该这样做如果设置了适当的权限,工作。

你可以做我做的。

我从 my shiny server 上的软件包中托管了很多闪亮的应用程序,我所做的只是 setwd() 到闪亮应用程序的目录,然后调用 shinyAppDir(".").

例如:this code is responsible for this app


2.5 年后编辑:请注意,如果您有 global.R 文件,这将不起作用 - 请参阅 github https://github.com/rstudio/shiny/issues/1063

上的此问题

我的解决方法是明确来源 global.R