class: center, middle, inverse, title-slide .title[ # Dockerizing a Shiny App ] .author[ ### Justin Post ] --- # Docker Recap - You have a model, app, etc. - You want to share it or make it available Docker - a 'container' to easily transport your code to others - Include all relevant files (R, packages, etc.) - No chance of code not running, bugs, etc. (if you've done things right!) --- # Dockerizing Shiny Apps [Article 1](https://juanitorduz.github.io/dockerize-a-shinyapp/) and [Article 2](https://www.statworx.com/en/blog/how-to-dockerize-shinyapps/) on commands needed to Dockerize a shiny app - If you can host your app somewhere, not really a need to dockerize... --- # Dockerizing a Shiny App - Create app in a folder with all files needed (images, etc) + All paths relative! - Pull appropriate docker image + `docker pull rocker/shiny-verse` - Create the `DOCKERFILE` - Build the image + `docker build -t <NAME> <DOCKERFILE PATH>` + If in directory of `DOCKERFILE`, just put '.' for path - Deploy the image + Ex: `docker run -p 3838:3838 <NAME>` --- # Example Dockerization Let's Dockerize a basic app - An app to visualize bayes theorem