Split Dockerfile into base + app layers for fast CI rebuilds
All checks were successful
Deploy stAndrews / deploy (push) Successful in 6s
All checks were successful
Deploy stAndrews / deploy (push) Successful in 6s
Base image (standrews-base) contains system deps and R packages. App Dockerfile is now just COPY + permissions — rebuilds in seconds.
This commit is contained in:
37
Dockerfile.base
Normal file
37
Dockerfile.base
Normal file
@@ -0,0 +1,37 @@
|
||||
FROM rocker/shiny:4.5.2
|
||||
|
||||
# 1. System dependencies (spatial stack required for sf)
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
build-essential \
|
||||
cmake \
|
||||
curl \
|
||||
libabsl-dev \
|
||||
libcurl4-openssl-dev \
|
||||
libfontconfig1-dev \
|
||||
libfreetype6-dev \
|
||||
libfribidi-dev \
|
||||
libgdal-dev \
|
||||
libgeos-dev \
|
||||
libharfbuzz-dev \
|
||||
libicu-dev \
|
||||
libjpeg-dev \
|
||||
libpng-dev \
|
||||
libproj-dev \
|
||||
libssl-dev \
|
||||
libtiff5-dev \
|
||||
libudunits2-dev \
|
||||
libxml2-dev \
|
||||
pkg-config \
|
||||
proj-bin \
|
||||
proj-data \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /srv/shiny-server
|
||||
|
||||
# 2. Copy lockfile and restore R packages
|
||||
COPY renv.lock .
|
||||
|
||||
ENV RENV_PATHS_LIBRARY=/usr/local/lib/R/site-library
|
||||
|
||||
RUN R -q -e "install.packages('renv', repos='https://cloud.r-project.org')" \
|
||||
&& R -q -e "renv::restore(library='/usr/local/lib/R/site-library', prompt=FALSE)"
|
||||
Reference in New Issue
Block a user