-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDockerfile
More file actions
93 lines (82 loc) · 2.82 KB
/
Dockerfile
File metadata and controls
93 lines (82 loc) · 2.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
FROM docker.io/rocker/r-ver:4.5 AS build
ENV MAKEFLAGS="-j4"
RUN --mount=type=cache,id=apt-cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,id=apt-lists,target=/var/lib/apt/lists,sharing=locked \
apt-get -y update && apt-get install -y \
default-jre \
default-jdk \
libssl-dev \
python3-dev \
libpcre2-dev \
libdeflate-dev \
liblzma-dev \
libbz2-dev \
libicu-dev \
xz-utils \
libcurl4-openssl-dev \
curl \
ca-certificates \
libxml2-dev \
libpng-dev \
cmake \
libfontconfig1-dev \
libgit2-dev \
libharfbuzz-dev \
libfribidi-dev \
libfreetype6-dev \
libtiff5-dev \
libjpeg-dev \
--no-install-recommends
RUN R CMD javareconf
RUN echo 'options(repos = c(CRAN = "https://p3m.dev/cran/__linux__/noble/latest"))' >>"${R_HOME}/etc/Rprofile.site"
ENV PAK_CACHE_DIR=/root/.cache/R/pak
RUN --mount=type=cache,id=pak-cache,target=/root/.cache/R/pak,sharing=locked \
Rscript -e "install.packages('pak')"
RUN --mount=type=cache,id=pak-cache,target=/root/.cache/R/pak,sharing=locked \
Rscript -e "pak::pkg_install(c('remotes', 'CirceR', 'Eunomia', 'duckdb', 'testthat', 'ResultModelManager'))"
RUN Rscript -e "DatabaseConnector::downloadJdbcDrivers(dbms='all', pathToDriver='/database_drivers/')"
ENV DATABASECONNECTOR_JAR_FOLDER=/database_drivers/
ADD https://astral.sh/uv/0.8.13/install.sh /uv-installer.sh
RUN sh /uv-installer.sh \
&& rm /uv-installer.sh
ENV PATH="/root/.local/bin/:$PATH"
RUN --mount=type=cache,id=pip-cache,target=/root/.cache/uv,sharing=locked \
uv pip install --system --break-system-packages \
polars \
duckdb \
pyarrow \
numpy \
torch \
tqdm \
nvidia-ml-py
RUN --mount=type=secret,id=build_github_pat export GITHUB_PAT=$(cat /run/secrets/build_github_pat)
ARG GIT_BRANCH='main'
ARG GIT_COMMIT_ID_ABBREV
RUN Rscript -e "ref <- Sys.getenv('GIT_COMMIT_ID_ABBREV', unset = Sys.getenv('GIT_BRANCH')); remotes::install_github('ohdsi/DeepPatientLevelPrediction', ref=ref)" \
&& installGithub.r OHDSI/ROhdsiWebApi
FROM docker.io/rocker/rstudio:4.5
#
COPY --from=build /usr/local/lib/python3.12/dist-packages /usr/local/lib/python3.12/dist-packages
COPY --from=build /database_drivers /database_drivers
COPY --from=build /usr/local/lib/R/site-library /usr/local/lib/R/site-library
COPY --from=build /usr/local/lib/R/library /usr/local/lib/R/library
ENV RETICULATE_PYTHON=/usr/bin/python3
# runtime dependancies
RUN --mount=type=cache,id=apt-cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,id=apt-lists,target=/var/lib/apt/lists,sharing=locked \
apt-get -y update && apt-get install -y \
default-jre \
default-jdk \
libssl3 \
python3-dev \
libcurl4-openssl-dev \
libpcre2-8-0 \
libdeflate0 \
liblzma5 \
libbz2-1.0 \
libicu74 \
qpdf \
--no-install-recommends \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& R CMD javareconf