-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
18 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,31 @@ | ||
FROM rstudio/r-base:4.0-bullseye | ||
|
||
# Set working directory | ||
WORKDIR /usr/local/src/myscripts | ||
|
||
# Set environment variable for renv version | ||
ENV RENV_VERSION 0.14.0 | ||
# RUN rm /etc/apt/apt.conf.d/default | ||
RUN apt-get update -y && apt-get install -y dpkg-dev zlib1g-dev libssl-dev libffi-dev curl libcurl4-openssl-dev procps | ||
|
||
# Update apt-get and install system dependencies | ||
RUN apt-get update -y && \ | ||
apt-get install -y --no-install-recommends \ | ||
dpkg-dev zlib1g-dev libssl-dev libffi-dev \ | ||
libcurl4-openssl-dev curl procps && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
RUN R -e "install.packages('remotes', repos = c(CRAN = 'https://cloud.r-project.org'))" | ||
RUN R -e "remotes::install_github('rstudio/renv@${RENV_VERSION}')" | ||
# Install R packages including remotes and renv | ||
RUN R -e "install.packages('remotes', repos = 'https://cloud.r-project.org')" && \ | ||
R -e "remotes::install_github('rstudio/renv', ref = '${RENV_VERSION}')" || true | ||
|
||
# Install synapser with specific version | ||
RUN R -e "remotes::install_version('synapser', version = '0.11.7', repos = c('http://ran.synapse.org', 'http://cran.fhcrc.org'))" | ||
|
||
# Set Python environment variable for R | ||
ENV PYTHON /usr/local/lib/R/site-library/PythonEmbedInR/bin/python3.6 | ||
|
||
|
||
# Copy the local project files into the container | ||
COPY . . | ||
|
||
RUN R -e "renv::restore()" | ||
# Restore R environment with renv | ||
RUN R -e "renv::restore()" |