-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile.base
53 lines (42 loc) · 1.87 KB
/
Dockerfile.base
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
FROM node:16
# Docker default of `/bin/sh` doesn't support `source`
SHELL ["/bin/bash", "-c"]
# Add Conda repository
# https://docs.conda.io/projects/conda/en/latest/user-guide/install/rpm-debian.html
RUN curl https://repo.anaconda.com/pkgs/misc/gpgkeys/anaconda.asc | gpg --dearmor > conda.gpg && \
install -o root -g root -m 644 conda.gpg /usr/share/keyrings/conda-archive-keyring.gpg && \
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/conda-archive-keyring.gpg] https://repo.anaconda.com/pkgs/misc/debrepo/conda stable main" > /etc/apt/sources.list.d/conda.list
# Install Conda and other OS-level dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
conda \
pandoc \
libgmp10 \
libpq-dev \
libxrender1 \
texlive-full
# Work around a font rendering problem; see
# https://github.com/kobotoolbox/reports/issues/136
# FIXME: figure out what subset of `texlive-full` is actually needed
# Do not `apt-get autoremove` after this(!) since it would remove necessary
# packages
RUN apt-get remove -y tex-gyre
# `apt-get install conda` does not actually put Conda on the PATH
ENV PATH="/opt/conda/bin:$PATH"
RUN conda update --yes conda
RUN mkdir /app
WORKDIR /app
# Copy only the files that define dependencies, not all the source files, to
# avoid unnecessarily invalidating the Docker layer cache
COPY environment.yml /app/
COPY jsapp/package.json jsapp/package-lock.json /app/jsapp/
# Install Python and R dependencies
RUN conda env create
# Install R libraries not available through Conda
RUN source activate koboreports && \
Rscript -e "install.packages('pander', repos='http://cran.rstudio.com/', type='source')" \
-e "library(pander)"
# At this time, the `node:14` image includes npm 6, but npm pesters us about
# upgrading to 7. Oblige it:
RUN npm install -g npm@7
# Install Node.js dependencies
RUN cd jsapp && npm install