@@ -12,22 +12,28 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
1212# 3. Setup Environment
1313ENV R_LIBS_USER=/opt/renv/library
1414ENV 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
1617WORKDIR /project
1718
1819# 4. Restore Packages (Cached Layer)
1920COPY renv.lock .Rprofile ./
2021COPY 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+
2126RUN mkdir -p /opt/renv/library
27+ # Now renv::restore will work
2228RUN 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
2632COPY . .
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 .
3137ENTRYPOINT ["sh" , "-c" , "ln -sf /project/$1 /project/configuration.yml && R --vanilla -e 'bookdown::render_book(\" index.Rmd\" )'" , "--" ]
3238
3339CMD ["configuration.yml" ]
0 commit comments