gpt4 book ai didi

shiny - 使用 shinyproxy 部署 shiny - 没有应用程序显示

转载 作者:行者123 更新时间:2023-12-04 16:21:16 26 4
gpt4 key购买 nike

我开发了一个 Shiny 的应用程序,我正在尝试使用 shinyproxy 进行首次轻量级部署。所有安装似乎都很好。我已经安装了 docker,java。

我认为构建一个包装应用程序和其他功能的包是个好主意。所以我开发了一个包 (CI),CI::launch_application 基本上是 shiny 包的 RunApp 函数的包装器。这是代码:

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

我用这个 Dockerfile 成功构建了 docker 镜像

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()"]

这是我的application.yml文件

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

当我启动 java shinyproxy.jar 并访问带有我公开的端口的 url 时,我看到了一个登录掩码。我使用简单例份验证登录(从 shinyproxy.log 登录成功)但既没有显示应用程序也没有显示应用程序列表。当我在本地启动应用程序时,一切都很好。

谢谢

最佳答案

application.yml 中允许的用户组有一个打印错误(应该是 scientists over scientist):

 access-groups: scientists

关于shiny - 使用 shinyproxy 部署 shiny - 没有应用程序显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59249993/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com