Skip to content

Commit 7466305

Browse files
committed
fix: streamline pak installation and dependency handling in Dockerfile
1 parent dbce06d commit 7466305

1 file changed

Lines changed: 2 additions & 12 deletions

File tree

Dockerfile

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,26 +20,16 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
2020
&& apt-get clean \
2121
&& rm -rf /var/lib/apt/lists/*
2222
# Install pak
23-
RUN Rscript -e 'if (!requireNamespace("pak", quietly = TRUE)) { \
24-
install.packages("pak", repos = "https://cloud.r-project.org") }'
25-
26-
# Copy only dependency information first to leverage Docker caching
27-
COPY DESCRIPTION /tmp/
23+
RUN Rscript -e 'if (!requireNamespace("pak", quietly = TRUE)) { install.packages("pak") }'
2824

2925
# Install package dependencies using pak - extract them from DESCRIPTION
30-
RUN cd /tmp && \
31-
Rscript -e 'deps <- pak::pkg_deps_tree(".", dependencies = TRUE)$package; \
32-
pak::pkg_install(deps, ask = FALSE)'
26+
RUN Rscript -e 'pak::pkg_install("bhklab/PharmacoGx", ask = FALSE, dependencies = TRUE, upgrade = FALSE)'
3327

3428
# Copy the local package files
3529
COPY . /app
3630

3731
# Set working directory
3832
WORKDIR /app
3933

40-
# Build and install the package
41-
RUN R CMD build . && \
42-
R CMD INSTALL *.tar.gz
43-
4434
# Default command when the container starts
4535
CMD ["R"]

0 commit comments

Comments
 (0)