rstudio / shiny-server

Host Shiny applications over the web.
https://rstudio.com/shiny/server
Other
716 stars 289 forks source link

Serve Bookdown Produced Document #488

Closed GrayAlex49 closed 3 years ago

GrayAlex49 commented 3 years ago

According to the shiny server docs, an r-markdown with an index (like a bookdown doc) should be served by shiny if its in the /srv/shiny-server/ folder.

I cloned the sample bookdown example and mounted it to a shiny server.

Dockerfile:

FROM rocker/shiny-verse:4.0.5

RUN install2.r -e bookdown

Docker Compose:

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'

This should serve the book at localhost/book however I only get a blank page and stdout message:

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

The file that it creates is not what it should create either. enter image description here

How can I utilize shiny server to effectively serve app documentation? It seems like this should work.

jcheng5 commented 3 years ago

(Sorry for the delay in responding!)

Sorry, Shiny Server is only designed to serve interactive R markdown documents, that is, ones with runtime: shiny or runtime: shiny_prerendered.

What Shiny Server can do is take your rendered bookdown site (i.e. just static HTML files) and serve those up, but at that point, you're better off with a regular static HTTP server, like nginx or Apache.