Skip to content

Commit 687ba32

Browse files
committed
install renv before installing
1 parent 6415eca commit 687ba32

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

Dockerfile

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,28 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
1212
# 3. Setup Environment
1313
ENV R_LIBS_USER=/opt/renv/library
1414
ENV RENV_PATHS_LIBRARY=/opt/renv/library
15-
ENV R_PROFILE_USER=/dev/null
15+
# This prevents your local .Rprofile from causing loops during build
16+
ENV R_PROFILE_USER=/dev/null
1617
WORKDIR /project
1718

1819
# 4. Restore Packages (Cached Layer)
1920
COPY renv.lock .Rprofile ./
2021
COPY renv/activate.R renv/activate.R
22+
23+
# Bootstrap: Install renv from binaries for speed
24+
RUN R -e "options(repos = c(CRAN = 'https://packagemanager.posit.co/cran/__linux__/noble/latest')); install.packages('renv')"
25+
2126
RUN mkdir -p /opt/renv/library
27+
# Now renv::restore will work
2228
RUN R -e "renv::restore(library='/opt/renv/library')"
2329

2430
# 5. Copy ALL Application Files
25-
# This brings in 3PodR.R, chapters/, R/, and everything else
31+
# This ensures 3PodR.R, chapters/, R/, style.css, etc. are included
2632
COPY . .
2733

2834
# 6. Execution Logic
29-
# We use a symlink so that whatever config file you pass at runtime
30-
# becomes the "configuration.yml" your R code expects.
35+
# We force the symlink and run render_book.
36+
# Using index.Rmd ensures bookdown merges your chapters correctly.
3137
ENTRYPOINT ["sh", "-c", "ln -sf /project/$1 /project/configuration.yml && R --vanilla -e 'bookdown::render_book(\"index.Rmd\")'", "--"]
3238

3339
CMD ["configuration.yml"]

0 commit comments

Comments
 (0)