r - 在 Google Cloud App Engine 上部署 Shiny 的应用程序会返回错误

标签 r google-app-engine shiny google-cloud-platform dockerfile

我正在尝试在 Google Cloud App Engine 灵活环境中部署一个 Shiny 的应用程序(没有 Shiny 的服务器)。因此,我对我的 shiny 应用程序进行了 docker 化,它在我的计算机上运行良好。

这是 app.yaml :

runtime: custom
env: flex

这是我的 docker 文件:

# start with the official R project base image
FROM r-base:latest

# copy this github repo into the Docker image and set as the working directory
COPY . /usr/local/src/myscripts
WORKDIR /usr/local/src/myscripts

# Install the C/C++ libraries needed to run the script
RUN apt-get update \
   && apt-get install -y --no-install-recommends \
libssl-dev \
libcurl4-openssl-dev \
libxml2-dev

# Install the R libraries needed to run the scripts
RUN /usr/bin/R --vanilla -f install_libraries.R

EXPOSE 8080

# Execute the target script
CMD ["Rscript", "run.R"]

这是我的 Rcode 启动我 Shiny 的应用程序:run.R

library(shiny)
runApp(port = 8080, host = "0.0.0.0",launch.browser = FALSE)

所有部署都进行得很顺利,但是当我转到我的应用程序引擎时 - https://.appspot.com/- 我在控制台中出现此错误。应用程序看起来是灰色的。

enter image description here

有没有办法将我 Shiny 的应用放在应用引擎而不是计算引擎上?

最佳答案

Shiny 基于 App Engine 目前不支持的 WebSockets。但是,它们现在(link)在灵活环境中开箱即用。这使得 Shiny App 非常容易在 App Engine 上部署。从本质上讲,您的代码现在应该可以正常工作。

关于r - 在 Google Cloud App Engine 上部署 Shiny 的应用程序会返回错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53051531/

相关文章:

r - 从矢量值命名对象

r - 使用 ggplot 创建 float 饼图

html - 将文本定位在 R shiny 中的 Action Button 中

java - 按 ID 以外的属性获取实体

R - Shiny 应用程序中 visNetwork 与 networkd3 的最先进性能 (2017)

jquery - R Shiny 的鼠标悬停到所有表格单元格

r - 在 R 中使用随机森林预测的不同结果

python - 如何检查是否有人更改了实体数据

java - INVALID_BLOB_KEY 关于使用 java 从谷歌云存储中检索图像

r - 隐藏/显示输出 Shiny R