从 Shiny Server 提供 Bookdown

Serving Bookdown from Shiny Server

根据 shiny server docs,带有索引的 r-markdown(如 bookdown 文档)如果位于 /srv/shiny-server/ 文件夹中,则应由 shiny 提供。

我克隆了 sample bookdown example 并将其安装到闪亮的服务器上。

Docker文件:

FROM rocker/shiny-verse:4.0.5

RUN install2.r -e bookdown

Docker撰写:

version: '3.8'
services:

    app:
        build: 
            context: ./
            dockerfile: Dockerfile
        image: bookdown_test
        container_name: bookdown_test
        restart: always
        #user: 'root'
        volumes:
            - ./bookdown-demo:/srv/shiny-server/book
        ports:
            - '80:3838'

这本书应该在 localhost/book 上投放,但是我只得到一个空白页和标准输出消息:

bookdown_test  | processing file: index.Rmd
bookdown_test  | output file: /tmp/shiny/rmarkdown/1dd8e4d901d7b5552128fdca39407670/index.knit.md
bookdown_test  |
bookdown_test  |
bookdown_test  | Output created: section-prerequisites.html

它创建的文件也不是它应该创建的文件。

如何利用 shiny server 有效地提供应用程序文档?看来这应该行得通。

我目前为闪亮应用程序提供闪亮应用程序文档的工作流程是在 docker 构建过程中呈现文档并将它们复制到闪亮应用程序 www 文件夹中

COPY manual /manual

RUN R -q -e "rmarkdown::render_site(input = '/manual/', output_format = 'bookdown::bs4_book', encoding = 'UTF-8')" \
  && mv /manual/_book /root/app/www/manual

Joe Cheng's explanation 错误发生的原因