From 4c29584cc7fef7a9815d83bba764a722646e1b18 Mon Sep 17 00:00:00 2001 From: Tomas Martinovic Date: Fri, 30 Aug 2024 12:17:27 +0200 Subject: [PATCH] Update dockerfile --- Dockerfile | 27 +-------------------------- Dockerfile_base | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 26 deletions(-) create mode 100644 Dockerfile_base diff --git a/Dockerfile b/Dockerfile index 61408ae..4f9cefa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,29 +1,4 @@ -FROM rocker/r-ver:4.3.3 - -RUN apt-get update -y && apt-get install -y make pandoc zlib1g-dev libcurl4-openssl-dev libssl-dev libicu-dev libpng-dev libgdal-dev gdal-bin libgeos-dev libproj-dev libsqlite3-dev git libudunits2-dev libxt6 && rm -rf /var/lib/apt/lists/* -RUN mkdir -p /usr/local/lib/R/etc/ /usr/lib/R/etc/ - -# Add Docker's official GPG key: -RUN apt-get update -y -RUN apt-get install ca-certificates curl -y -RUN install -m 0755 -d /etc/apt/keyrings -RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc -RUN chmod a+r /etc/apt/keyrings/docker.asc - -# Add the repository to Apt sources: -RUN echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null -RUN apt-get update -y -RUN apt-get install -y docker-ce docker-ce-cli - -RUN mkdir /.cache -RUN chmod 777 /.cache . -WORKDIR /code - -RUN echo "options(renv.config.pak.enabled = FALSE, repos = c(CRAN = 'https://cran.rstudio.com/'), download.file.method = 'libcurl', Ncpus = 4)" | tee /usr/local/lib/R/etc/Rprofile.site | tee /usr/lib/R/etc/Rprofile.site -RUN R -e 'install.packages("remotes")' -RUN R -e 'remotes::install_version("renv", version = "1.0.7")' -COPY renv.lock renv.lock -RUN R -e 'renv::restore()' +FROM biodt-shiny-base AS biodt-shiny # Copy application code COPY . . diff --git a/Dockerfile_base b/Dockerfile_base new file mode 100644 index 0000000..f3d2d0c --- /dev/null +++ b/Dockerfile_base @@ -0,0 +1,27 @@ +FROM rocker/r-ver:4.3.3 AS biodt-shiny-base + +RUN apt-get update -y && apt-get install -y make pandoc zlib1g-dev libcurl4-openssl-dev libssl-dev libicu-dev libpng-dev libgdal-dev gdal-bin libgeos-dev libproj-dev libsqlite3-dev git libudunits2-dev libxt6 && rm -rf /var/lib/apt/lists/* +RUN mkdir -p /usr/local/lib/R/etc/ /usr/lib/R/etc/ + +# Add Docker's official GPG key: +RUN apt-get update -y +RUN apt-get install ca-certificates curl -y +RUN install -m 0755 -d /etc/apt/keyrings +RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc +RUN chmod a+r /etc/apt/keyrings/docker.asc + +# Add the repository to Apt sources: +RUN echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null +RUN apt-get update -y +RUN apt-get install -y docker-ce docker-ce-cli + +RUN mkdir /.cache +RUN chmod 777 /.cache . +WORKDIR /code + +RUN echo "options(renv.config.pak.enabled = FALSE, repos = c(CRAN = 'https://cran.rstudio.com/'), download.file.method = 'libcurl', Ncpus = 4)" | tee /usr/local/lib/R/etc/Rprofile.site | tee /usr/lib/R/etc/Rprofile.site +RUN R -e 'install.packages("remotes")' +RUN R -e 'remotes::install_version("renv", version = "1.0.7")' +COPY renv.lock renv.lock +RUN R -e 'renv::restore()' +