-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
67 lines (52 loc) · 2.55 KB
/
Copy pathDockerfile
File metadata and controls
67 lines (52 loc) · 2.55 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
# Use official Rocker tidyverse image as base
FROM rocker/tidyverse:4.3.1
# Install system dependencies and R packages
RUN apt-get update && \
apt-get install -y --no-install-recommends \
openjdk-11-jre-headless \
libglpk-dev && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Install R packages using Rocker's included `install2.r` function
RUN install2.r --error \
plumber \
bigrquery \
googleCloudStorageR \
rJava \
remotes \
logger
# Install additional R packages from GitHub
# Use upgrade = 'never' to prevent downgrading DatabaseConnector from 7.0.0+ to 6.2.4
RUN R -e "remotes::install_github('OHDSI/DataQualityDashboard@v2.8.0', dependencies = TRUE, upgrade = 'never')"
# Explicitly install/upgrade DatabaseConnector to version 7.0.0+ (required by Achilles develop branch)
# DQD installs 6.2.4 from CRAN, but Achilles requires >= 7.0.0 (which is currently only on GitHub)
RUN R -e "remotes::install_github('OHDSI/DatabaseConnector@v7.0.0')"
# Similar situation with SqlRender; DQD installs 1.14.x, but Achilles dev requires >= 1.19.2
RUN R -e "remotes::install_github('OHDSI/SqlRender@v1.19.4')"
# Install Achilles from forked branch with BigQuery type coercion fix
# This includes:
# - Fix for jsonlite fromJSON bug (PR #743) in exportToJson.R
# - Fix for BigQuery INT64/FLOAT64 type coercion bug (issue #801)
# Branch: fix-801-bigquery-type-coercion from eddy-ccc/Achilles fork
RUN R -e "remotes::install_github('eddy-ccc/Achilles@fix-801-bigquery-type-coercion', dependencies = TRUE, upgrade = 'always')"
# Install OMOP Delivery Report package from GitHub
RUN R -e "remotes::install_github('Analyticsphere/omopDeliveryReport@v2.0.0', dependencies = TRUE, upgrade = 'always', force = TRUE)"
# Install PASS (Profile of Analytic Suitability Score) package from GitHub
RUN R -e "remotes::install_github('Analyticsphere/PASS@v0.2.0', dependencies = TRUE, upgrade = 'always', force = TRUE)"
# Configure R to use Java
RUN R CMD javareconf
# Set the working directory
WORKDIR /app
# Copy all code and resources into the container
COPY . /app
# Set environment variable pointing to local BigQuery connector JAR files
ENV DATABASECONNECTOR_JAR_FOLDER=/app/bq_drivers
# Expose the desired API port
EXPOSE 8080
# Copy entrypoint script
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
# Set entrypoint to the script, which will then exec the R process
ENTRYPOINT ["/entrypoint.sh"]
# Default CMD runs the Plumber API as before
CMD ["R", "-e", "pr <- plumber::plumb('plumber_api.R'); pr$run(host='0.0.0.0', port=as.numeric(Sys.getenv('PORT')))"]