{"id":13942635,"url":"https://github.com/analythium/rmarkdown-docker-examples","last_synced_at":"2026-01-07T15:58:13.648Z","repository":{"id":43863656,"uuid":"511689033","full_name":"analythium/rmarkdown-docker-examples","owner":"analythium","description":"R Markdown Examples with Docker","archived":false,"fork":false,"pushed_at":"2022-10-26T02:16:33.000Z","size":407,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-27T12:36:49.346Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/analythium.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-07-07T22:17:24.000Z","updated_at":"2023-06-04T12:41:07.000Z","dependencies_parsed_at":"2023-01-20T04:03:34.805Z","dependency_job_id":null,"html_url":"https://github.com/analythium/rmarkdown-docker-examples","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/analythium/rmarkdown-docker-examples","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/analythium%2Frmarkdown-docker-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/analythium%2Frmarkdown-docker-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/analythium%2Frmarkdown-docker-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/analythium%2Frmarkdown-docker-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/analythium","download_url":"https://codeload.github.com/analythium/rmarkdown-docker-examples/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/analythium%2Frmarkdown-docker-examples/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266076350,"owners_count":23872741,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-08T02:01:57.873Z","updated_at":"2026-01-07T15:58:13.593Z","avatar_url":"https://github.com/analythium.png","language":null,"funding_links":[],"categories":["Others"],"sub_categories":[],"readme":"# R Markdown Examples with Docker\n\nThis repository contains code for the blog post [Containerizing Interactive R Markdown Documents](https://hosting.analythium.io/containerizing-interactive-r-markdown-documents/) from the _Hosting Data Apps_ website -- [hosting.analythium.io](https://hosting.analythium.io/).\n\n## Runtime: shiny\n\nRead [Introduction to interactive documents](https://shiny.rstudio.com/articles/interactive-docs.html) for details on this runtime.\n\n```bash\ndocker build -f Dockerfile.shiny -t psolymos/rmd:shiny .\n\ndocker run -p 8080:3838 psolymos/rmd:shiny\n```\n\n## Runtime: shinyrmd\n\n\u003e The runtime `shinyrmd` was introduced in [rmarkdown version 2.5](https://rmarkdown.rstudio.com/docs/news/index.html#rmarkdown-25) as an alias for the runtime `shiny_prerendered`.\n\nRead [Prerendered Shiny documents](https://rmarkdown.rstudio.com/authoring_shiny_prerendered.HTML) for details on this runtime.\n\n```bash\ndocker build -f Dockerfile.shinyrmd -t psolymos/rmd:shinyrmd .\n\ndocker run -p 8080:3838 psolymos/rmd:shinyrmd\n```\n\nThe [learnr](https://CRAN.R-project.org/package=learnr) R package is for creating interactive tutorials using R Markdown. It also uses the prerendered Shiny runtime, so here is an [example](https://github.com/rstudio/learnr/blob/main/inst/tutorials/ex-setup-r/ex-setup-r.Rmd):\n\n```bash\ndocker build -f Dockerfile.learnr -t psolymos/rmd:learnr .\n\ndocker run -p 8080:3838 psolymos/rmd:learnr\n```\n\n## Runtime: static\n\nOne option is to render the HTML output locally and copy all these static assets into an Nginx image:\n\n```dockerfile\nFROM nginx:alpine\nCOPY runtime-static /usr/share/nginx/html\nCMD [\"nginx\", \"-g\", \"daemon off;\"]\n```\n\nThis implies that you have all the necessary tools installed on your local machine.\n\nAlternatively, you can use [multi-stage build](https://docs.docker.com/develop/develop-images/multistage-build/) to keep your image size small:\n\n```bash\ndocker build -f Dockerfile.static -t psolymos/rmd:static .\n\ndocker run -p 8080:80 psolymos/rmd:static\n```\n\nAnother option is to use the static mode of the [of-watchdog](https://github.com/openfaas/of-watchdog) from the [OpenFaaS](https://www.openfaas.com/) project.\n\n\u003e The of-watchdog implements a HTTP server listening on port 8080, and acts as a reverse proxy for running functions and microservices. It can be used independently, or as the entrypoint for a container with OpenFaaS.\n\n```bash\ndocker build -f Dockerfile.static2 -t psolymos/rmd:static2 .\n\ndocker run -p 8080:8080 psolymos/rmd:static2\n```\n\nLet's compare the image sizes:\n\n```bash\ndocker image ls psolymos/rmd --format \"{{.Repository}}\\t{{.Tag}}\\t{{.Size}}\"\n# psolymos/rmd    static2     32.7MB\n# psolymos/rmd    static      24.3MB\n# psolymos/rmd    shinyrmd    1.06GB\n# psolymos/rmd    shiny       1.05GB\n```\n\n## License\n\nMIT License (c) 2022 Analythium Solutions Inc.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanalythium%2Frmarkdown-docker-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanalythium%2Frmarkdown-docker-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanalythium%2Frmarkdown-docker-examples/lists"}