-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.prod
More file actions
62 lines (55 loc) · 1.44 KB
/
Dockerfile.prod
File metadata and controls
62 lines (55 loc) · 1.44 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
FROM rocker/geospatial:4.5
# System dependencies
RUN apt-get update -qq && apt-get -y --no-install-recommends install \
libxml2-dev \
libcairo2-dev \
libgit2-dev \
default-libmysqlclient-dev \
libpq-dev \
libsasl2-dev \
libsqlite3-dev \
libssh2-1-dev \
libnode-dev \
unixodbc-dev \
python3-dev \
python3-pip \
python3-venv && \
rm -rf /var/lib/apt/lists/*
# Tell reticulate which Python to use — set after venv is created below
# (placeholder overridden by the ENV at the end of this file)
# Install R packages from CRAN
RUN install2.r --error --skipinstalled \
arrow \
config \
dplyr \
V8 \
h3jsr \
furrr \
future \
git2r \
googleAuthR \
googleCloudStorageR \
httr2 \
logger \
magrittr \
mongolite \
parallel \
purrr \
readr \
reticulate \
rlang \
sf \
stringr \
tidyr \
remotes
# Install local package
COPY . /home
WORKDIR /home
RUN Rscript -e 'remotes::install_local(dependencies = TRUE)'
# Install ssfaitk into an isolated venv (avoids PEP 668 system-package restrictions)
RUN python3 -m venv /opt/ssfaitk && \
/opt/ssfaitk/bin/pip install --upgrade pip setuptools wheel && \
/opt/ssfaitk/bin/pip install "git+https://github.com/WorldFishCenter/ssf-ai-toolkit@plug-R"
# Point reticulate at the venv Python that has ssfaitk installed
ENV RETICULATE_PYTHON=/opt/ssfaitk/bin/python3
ENTRYPOINT ["Rscript"]