diff --git a/.dockerignore b/.dockerignore index 802600a..7e28225 100644 --- a/.dockerignore +++ b/.dockerignore @@ -5,6 +5,7 @@ .gitignore renv/library +renv/cache renv/staging *.Rproj \ No newline at end of file diff --git a/.gitignore b/.gitignore index 5a242ad..5c07119 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ # renv local library/state (keep renv.lock and renv/activate.R tracked) renv/library/ +renv/cache/ renv/python/ renv/staging/ diff --git a/Dockerfile b/Dockerfile index 3a4c3fc..a524af4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,7 +27,7 @@ COPY .Rprofile /srv/shiny-server/.Rprofile # Prevent renv attempting to use pak ENV RENV_CONFIG_PAK_ENABLED=FALSE ENV RENV_DOWNLOAD_METHOD=libcurl -ENV RENV_PATHS_CACHE=/opt/renv/cache +ENV RENV_PATHS_CACHE=/srv/shiny-server/renv/cache # Some CRAN packages in this lockfile fail under Ubuntu hardening defaults # because -Werror=format-security turns benign warnings into build failures. @@ -38,9 +38,7 @@ RUN for f in /usr/local/lib/R/etc/Makeconf /usr/lib/R/etc/Makeconf; do \ done # Install renv and restore project packages -RUN --mount=type=cache,target=/opt/renv/cache \ - --mount=type=cache,target=/root/.cache/R/renv \ - R --vanilla -e "install.packages('renv', repos='https://cran.rstudio.com')" && \ +RUN R --vanilla -e "install.packages('renv', repos='https://cran.rstudio.com')" && \ R --vanilla -e "source('.Rprofile'); renv::restore(prompt=FALSE)" # Copy the application after dependencies so regular code changes do not