Skip to content

Commit

Permalink
Create minimal docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
r-ash committed Dec 24, 2024
1 parent 6b0b424 commit 05ab6f9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 37 deletions.
48 changes: 11 additions & 37 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,48 +1,22 @@
FROM ghcr.io/hivtools/naomi-base:latest

RUN apt-get update && apt-get -y install --no-install-recommends \
libhiredis-dev \
libjq-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

RUN install_packages --repo=https://mrc-ide.r-universe.dev \
callr \
docopt \
eppasm \
geojsonio \
glue \
jsonlite \
jsonvalidate \
lgr \
naomi.options \
first90 \
plumber \
porcelain \
ps \
remotes \
rlang \
rrq

FROM ghcr.io/hivtools/naomi-base:minimal

COPY . /src
COPY docker/Rprofile.site /usr/local/lib/R/etc/Rprofile.site
COPY docker/bin /usr/local/bin/

# If tracking development versions of packages, install via
# github. However, limt this (and prefer updating the drat) as this
# can hit rate limits as we cannot use a PAT when building the
# container.
# RUN install_remote \
# mrc-ide/naomi.options

COPY . /src
RUN R CMD INSTALL /src/naomi \
&& cd /src && ./scripts/build_test_data \
&& R CMD INSTALL /src
RUN cd /src \
&& ./scripts/build_test_data \
&& find /src/inst/output -type f ! -name "malawi_model_output.qs" -delete \
&& R CMD INSTALL /src \
&& rm -r /src

EXPOSE 8888
ENV HINTR_QUEUE_ID=hintr

## Model run will try to parallelise over as many threads as are available
## potentially slowing the application, manually limit threads to 1
ENV OMP_NUM_THREADS=1

WORKDIR /

ENTRYPOINT ["/usr/local/bin/hintr_api"]
1 change: 1 addition & 0 deletions docker/Rprofile.site
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
options(knitr.chunk.dev = 'svglite')

0 comments on commit 05ab6f9

Please sign in to comment.