# Bookdown on Shinyproxy

**URL:** <https://support.openanalytics.eu/t/bookdown-on-shinyproxy/943>\
**Category:** ShinyProxy\
**Created:** [February 8, 2019, 4:23pm UTC](https://support.openanalytics.eu/t/bookdown-on-shinyproxy/943 "2019-02-08T16:23:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![akenny](https://support.openanalytics.eu/letter_avatar_proxy/v4/letter/a/8e7dd6/32.png) [@akenny](https://support.openanalytics.eu/u/akenny)\
**Post date:** [February 8, 2019, 4:23pm UTC](https://support.openanalytics.eu/t/bookdown-on-shinyproxy/943/1 "2019-02-08T16:23:29Z")

</div>

Has anyone been able to get a bookdown site working in shinyproxy?

I can get a rmarkdown document rendering and showing using something like the following:  
`rmarkdown::run(file='/root/code/test_markdown.Rmd')`

But I haven’t been able to do the same with bookdown, when I run:  
`bookdown::serve_book(dir = '.', output_dir = '_book', preview = TRUE, in_session = TRUE, quiet = FALSE)`

I get a book to ‘knit’ but the app times out without redirecting me to the homepage

---

<div class="post-metadata">

**Author:** ![mnazarov](https://support.openanalytics.eu/user_avatar/support.openanalytics.eu/mnazarov/32/216_2.png) [@mnazarov](https://support.openanalytics.eu/u/mnazarov)\
**Post date:** [February 13, 2019, 10:37am UTC](https://support.openanalytics.eu/t/bookdown-on-shinyproxy/943/2 "2019-02-13T10:37:09Z")

</div>

Hi @akenny,

Yes, it works, the only thing is that you need to specify `host = "0.0.0.0"` for the `serve_book` and make sure the correct port is used in the `application.yml` (4321 by default, or you can pass a custom one to `serve_book` as well).

An example `Dockerfile` (assuming your book is contained in the “book” folder):

```auto
FROM openanalytics/r-base

# install required R packages
RUN install.r bookdown servr

# install pandoc
RUN wget https://github.com/jgm/pandoc/releases/download/2.6/pandoc-2.6-1-amd64.deb
RUN dpkg -i pandoc-2.6-1-amd64.deb

# copy your book contents
COPY book /root/book/

# use default port for shinyproxy apps, so you don't have to add port in application.yml
EXPOSE 3838  

CMD ["R", "-e", "bookdown::serve_book('/root/book', port = 3838, host = '0.0.0.0')"]

```
