在Google Cloud App Engine上部署闪亮的应用程序会返回错误

问题描述 投票:4回答:1

我正在尝试在Google Cloud App Engine灵活环境中部署一个闪亮的应用程序(没有闪亮的服务器)。所以我将我闪亮的应用程序停靠在我的计算机上。

这是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启动我的闪亮应用程序:run.R

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

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

enter image description here

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

r google-app-engine shiny google-cloud-platform dockerfile
1个回答
0
投票

Shiny基于App Engine目前不支持的WebSockets。然而,它们现在在Flexible环境中开箱即用(link)。这使得Shiny App非常容易在App引擎上进行部署。从本质上讲,您的代码现在应该正常工作。

© www.soinside.com 2019 - 2024. All rights reserved.