rename to containerfile
This commit is contained in:
parent
40346b2bc2
commit
f994490862
1 changed files with 29 additions and 0 deletions
29
docker/Containerfile-shiny-app
Normal file
29
docker/Containerfile-shiny-app
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
FROM devxygmbh/r-alpine:4.4-3.20 AS build
|
||||
|
||||
# ARG GITHUB_PAT
|
||||
RUN R -q -e 'install.packages("pak", repos = sprintf("https://r-lib.github.io/p/pak/devel/%s/%s/%s", .Platform$pkgType, R.Version()$os, R.Version()$arch))'
|
||||
|
||||
COPY --link ./DESCRIPTION .
|
||||
COPY --link ./R ./R
|
||||
# COPY --link ./man .
|
||||
COPY --link ./NAMESPACE .
|
||||
COPY --link ./shiny/app.R /app/app.R
|
||||
|
||||
RUN ls -la
|
||||
|
||||
# install R package deps
|
||||
RUN R -q -e 'pak::pak()'
|
||||
|
||||
RUN R CMD INSTALL --no-docs --without-keep.source .
|
||||
|
||||
# install shiny app deps
|
||||
RUN R -q -e "install.packages('renv'); pkgs <- renv::dependencies('/app/app.R')[['Package']]; pkgs = setdiff(pkgs, 'bincraftR'); pak::pak(pkgs)"
|
||||
|
||||
ENV PGPASS=""
|
||||
|
||||
RUN echo "options(shiny.port=3838, shiny.host='0.0.0.0')" >> /root/.Rprofile
|
||||
|
||||
WORKDIR /app
|
||||
EXPOSE 3838
|
||||
|
||||
CMD Rscript app.R
|
||||
Loading…
Reference in a new issue