Reputation: 603
I am trying to deploy a shiny app (without shiny server) on Google Cloud App Engine flexible environment. So I dockerised my shiny app and it works well on my computer.
Here is app.yaml :
runtime: custom
env: flex
Here is my docker file :
# 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"]
And here is my Rcode launching my shiny app : run.R
library(shiny)
runApp(port = 8080, host = "0.0.0.0",launch.browser = FALSE)
All the deploying goes well but when I go to my app engine -https://.appspot.com/ - I have this error in the console. And the application looks grey.
Is there a way to put my shiny app on an app engine and not on a compute engine ?
Upvotes: 4
Views: 1135
Reputation: 1495
Shiny is based on WebSockets that were not supported by the App Engine at this time. They are however supported now (link) out of the box in the Flexible environment. This makes a Shiny App very easy to Deploy on App engine. Essentially, your code should just work now.
Upvotes: 3