forked from PondiB/openeocubes
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
58 lines (46 loc) · 2.6 KB
/
Dockerfile
File metadata and controls
58 lines (46 loc) · 2.6 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
FROM r-base:4.5.0
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Etc/UTC
ENV CXXFLAGS="-O2 -pipe -std=gnu++17"
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates gnupg apt-transport-https \
build-essential cmake g++ git wget make \
automake libtool autoconf pkg-config supervisor \
ninja-build zip unzip \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -y --no-install-recommends \
libproj-dev libgdal-dev libgeos-dev \
libnetcdf-dev libcurl4-openssl-dev libcpprest-dev \
libsqlite3-dev libboost-all-dev \
libsodium-dev libudunits2-dev \
zlib1g-dev libunwind-dev libssl-dev libxml2-dev \
doxygen graphviz \
python3 python3-pip python3-dev \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
RUN git clone --depth 1 --branch 20230802.1 https://github.com/abseil/abseil-cpp.git /tmp/abseil && \
cmake -S /tmp/abseil -B /tmp/abseil/build \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DABSL_PROPAGATE_CXX_STD=ON \
-DABSL_ENABLE_INSTALL=ON && \
cmake --build /tmp/abseil/build -j"$(nproc)" && \
cmake --install /tmp/abseil/build && \
rm -rf /tmp/abseil
ENV PKG_CONFIG_PATH="/usr/local/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
RUN R -e "install.packages(c('remotes'), repos='https://cloud.r-project.org')"
RUN R -e "install.packages(c('devtools'), repos='https://cloud.r-project.org')"
RUN R -e "install.packages(c('gdalcubes','plumber','useful','ids','R6','s2','sf','rstac','bfast','geojsonsf'), repos='https://cloud.r-project.org')"
# Install missing required packages explicitly
# Note: stats and tools are base R packages, no need to install
RUN R -e "install.packages(c('kernlab','readr','reticulate','xgboost','randomForest','terra','abind','tidyr','httr','caret','torch','dplyr','base64enc','jsonlite','tibble','rlang'), repos='https://cloud.r-project.org')"
RUN mkdir -p /opt/dockerfiles/ /var/openeo/workspace/ /var/openeo/workspace/data/
COPY ./ /opt/dockerfiles/
RUN Rscript -e "options(warn=2); \
message('Installing openeocubes package...'); \
remotes::install_local('/opt/dockerfiles', dependencies = TRUE, force = TRUE, verbose = TRUE); \
message('Checking if package is installed:'); \
if(!('openeocubes' %in% rownames(installed.packages()))) stop('openeocubes package not installed!')"
RUN R -e "message('.libPaths(): ', paste(.libPaths(), collapse=', ')); \
if(!requireNamespace('openeocubes', quietly = TRUE)) stop('openeocubes package not installed!')"
EXPOSE 8000
CMD ["R", "-q", "--no-save", "-f", "/opt/dockerfiles/startProduction.R"]