Deploy shiny with shinyproxy - no app showing

一个人想着一个人 提交于 2021-02-19 03:54:07

问题


I've developed a shiny app and i'm trying to do a first lightweight deploy using shinyproxy. All installation seems fine. I've installed docker, java.

I thought that building a package that wraps the app and other function would be a good idea. So I developed a package (CI) and CI::launch_application is basically a wrapper around RunApp function of shiny package. This is the code:

launch_application <- function(launch.browser = interactive(), ...) {
  runApp(
    appDir = system.file("app", package = "CI"),
    launch.browser = launch.browser,
    ...
  )
}

I succesfully built the docker image with this Dockerfile

FROM rocker/r-base:latest

## Install required dependencies
RUN apt-get update \
  && apt-get install -y --no-install-recommends \
    ## for R package 'curl'
    libcurl4-gnutls-dev \
    apt-utils \
    ## for R package 'xml2'
    libxml2-dev \
    ## for R package 'openssl'
    libssl-dev \
    zlib1g-dev \
    default-jdk \
    default-jre \
  && apt-get clean \
  && R CMD javareconf \
  && rm -rf /var/lib/apt/lists/




## Install major fixed R dependencies
#  - they will always be needed and we want them in a dedicated layer,
#    as opposed to getting them dynamically via `remotes::install_local()`
RUN install2.r --error \
  shiny \
  dplyr \
  devtools \
  rJava \
  RJDBC

# copy the app to the image
RUN mkdir /root/CI
COPY . /root/CI

# Install CI
RUN install2.r --error remotes \
  && R -e "remotes::install_local('/root/CI')"

# Set host and port

RUN echo "options(shiny.port = 80, shiny.host = '0.0.0.0')" >> /usr/local/lib/R/Rprofile.site

EXPOSE 80

CMD ["R", "-e", "CI::launch_application()"]

This is my application.yml file

proxy:
  title:
  logo-url: http://www.openanalytics.eu/sites/www.openanalytics.eu/themes/oa/logo.png
  landing-page: /
  heartbeat-rate: 10000
  heartbeat-timeout: 60000
  port: 8080
  admin-groups: scientists

  users:
  - name: jack
    password: password
    groups: scientists
  - name: jeff
    password: password
    groups: mathematicians

  authentication: simple

  # Docker configuration
  docker:
    cert-path: /home/none
    url: http://localhost:2375
    port-range-start: 20000
  specs:
  - id: home
    display-name: Customer Intelligence
    description: Segment your customer
    container-cmd: ["R", "-e", "CI::launch_application()"]
    container-image: company/image
    access-groups: scientist

logging:
  file:
    shinyproxy.log

When I launch java shinyproxy.jar and i visited the url with the port I exposed, I see a login mask. I logged in with simple authentication ( login is successful from shinyproxy.log) but neither an app is showing nor a list of app. When I launch the app locally everything is fine.

Thanks


回答1:


There is a misprint in the allowed user group in application.yml (should be scientists over scientist):

 access-groups: scientists



回答2:


Dzimitry is right. It was a typo error: scientists over scientist.



来源:https://stackoverflow.com/questions/59249993/deploy-shiny-with-shinyproxy-no-app-showing

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!