Skip to content

Instantly share code, notes, and snippets.

@jcpsantiago
Created January 16, 2019 17:09
Show Gist options
  • Save jcpsantiago/1b0c078cefcc77fd04ae9d7cb2f2d859 to your computer and use it in GitHub Desktop.
Save jcpsantiago/1b0c078cefcc77fd04ae9d7cb2f2d859 to your computer and use it in GitHub Desktop.
Dockerfile with packrat
FROM rocker/r-ver:3.5.1
RUN apt-get update && apt-get install -y --no-install-recommends \
## needed for git2r
libssl-dev \
## needed for curl
libcurl4-openssl-dev
ENV APP_DIR /app
WORKDIR $APP_DIR
## install2.r will pull packrat from MRAN with the chosen R version
RUN install2.r -d TRUE packrat
COPY packrat $APP_DIR/packrat
RUN R -e "packrat::restore()"
COPY app $APP_DIR/app
CMD R -e 'source("packrat/init.R");options(shiny.autoreload=T,shiny.port=3838,shiny.host="0.0.0.0");shiny::runApp("app")'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment