Skip to content

Commit

Permalink
Update dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Nithador committed Aug 30, 2024
1 parent 9769eec commit 4c29584
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 26 deletions.
27 changes: 1 addition & 26 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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 . .
Expand Down
27 changes: 27 additions & 0 deletions Dockerfile_base
Original file line number Diff line number Diff line change
@@ -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()'

0 comments on commit 4c29584

Please sign in to comment.