Skip to content

Commit

Permalink
Add source package into subdir to avoid overwriting renv files
Browse files Browse the repository at this point in the history
  • Loading branch information
milanmlft committed Dec 9, 2024
1 parent 3790ea6 commit 9baa67c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
7 changes: 4 additions & 3 deletions app/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ FROM rocker/shiny-verse:4.4.1
WORKDIR /app
COPY --from=base /app .

# Install the app
ADD app .
RUN R -e 'devtools::install(".", dependencies = FALSE)'
# Install omopcat package
# Put package in a subdirectory to avoid overwriting renv files from previous stage
ADD app ./pkg
RUN R -e 'devtools::install("pkg", dependencies = FALSE)'

EXPOSE 3838
CMD ["R", "-e", "options('shiny.port'=3838, shiny.host='0.0.0.0'); omopcat::run_app()" ]
8 changes: 5 additions & 3 deletions preprocessing/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ COPY preprocessing/renv/settings.json renv/settings.json
RUN mkdir renv/.cache
ENV RENV_PATHS_CACHE renv/.cache

RUN install2.r --error --skipinstalled renv devtools remotes && \
RUN install2.r --error --skipinstalled renv && \
R -e 'renv::restore()' && \
rm -rf /tmp/downloaded_packages

Expand All @@ -27,7 +27,9 @@ FROM rocker/tidyverse:4.4.1
WORKDIR /pkg
COPY --from=base /pkg .

ADD preprocessing .
RUN R -e 'devtools::install(path = ".", dependencies = FALSE)'
# Install omopcat.preprocessing package
# Put package in a subdirectory to avoid overwriting renv files from previous stage
ADD preprocessing ./pkg
RUN R -e 'devtools::install(path = "pkg", dependencies = FALSE)'

CMD ["R", "-e", "omopcat.preprocessing::preprocess()"]

0 comments on commit 9baa67c

Please sign in to comment.