This repository has been archived by the owner on Jul 19, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
72 lines (64 loc) · 3.39 KB
/
Dockerfile
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
FROM node:10-alpine
LABEL maintainer="O: University of Halle (Saale) Germany; OU: ITZ, department application systems" \
license="Docker composition: MIT; Components: Please check"
ENV BATIK_VERSION="1.11" \
MATHJAX_RUN_USER="mathjax" \
MATHJAX_RUN_GROUP="mathjax" \
MATHJAX_RUN_UID="800" \
MATHJAX_RUN_GID="800" \
MATHJAX_HOME="/opt/mathjax" \
MATHJAX_PORT="8003" \
MATHJAX_VERSION="0.5.2" \
MATHJAX_SERVER_COMMIT="9c55118d90ae798c26949adae3e435e1670436bb" \
GOSU_VERSION="1.11"
RUN apk add --no-cache \
gnupg \
bash openssl curl tini \
openjdk8-jre-base \
### Install GoSu
&& set -ex \
&& for key in \
B42F6819007F00F88E364FD4036A9C25BF357DD4 \
; do \
gpg --batch --keyserver pgp.mit.edu --recv-keys "$key" || \
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" || \
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" || \
gpg --batch --keyserver keyserver.pgp.com --recv-keys "$key" || \
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" ; \
done \
&& set +x \
&& curl -o /usr/local/bin/gosu -fSL "https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-amd64" \
&& curl -o /usr/local/bin/gosu.asc -fSL "https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-amd64.asc" \
&& gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu \
&& rm /usr/local/bin/gosu.asc \
&& chmod +x /usr/local/bin/gosu \
### Install MathJax
&& mkdir -p "${MATHJAX_HOME}" && cd "${MATHJAX_HOME}" \
### use the GitHub links, not the packages from the npm repository
### install the release with PNG support
&& npm install "https://github.com/mathjax/MathJax-node/archive/${MATHJAX_VERSION}.tar.gz" \
&& npm install "https://github.com/tiarno/mathjax-server/tarball/${MATHJAX_SERVER_COMMIT}" \
&& cd "${MATHJAX_HOME}/node_modules" && ln -s mathjax-node MathJax-node \
### Additionally you need to install Apache Batic, if the MathJax server
### should be able to create PNG images. This is needed by ILIAS to support
### LaTeX in PDF files
&& cd "${MATHJAX_HOME}/node_modules/mathjax-node/batik" \
&& curl -o batik.tar.gz -L "http://www.apache.org/dyn/closer.cgi?filename=/xmlgraphics/batik/binaries/batik-bin-${BATIK_VERSION}.tar.gz&action=download" \
&& curl -o batik.tar.gz.asc -L "https://www.apache.org/dist/xmlgraphics/batik/binaries/batik-bin-${BATIK_VERSION}.tar.gz.asc" \
&& curl -o /tmp/batik-keys -L "https://www.apache.org/dist/xmlgraphics/batik/KEYS" \
&& gpg --import /tmp/batik-keys && rm /tmp/batik-keys \
&& gpg --batch --verify ./batik.tar.gz.asc ./batik.tar.gz && rm ./batik.tar.gz.asc \
&& tar xf batik.tar.gz && rm batik.tar.gz \
&& ln -s "batik-${BATIK_VERSION}/batik-rasterizer-${BATIK_VERSION}.jar" batik-rasterizer.jar \
&& ln -s "batik-${BATIK_VERSION}/lib" lib \
&& addgroup -S -g "${MATHJAX_RUN_GID}" "${MATHJAX_RUN_GROUP}" \
&& adduser -S -D -H -G "${MATHJAX_RUN_GROUP}" -h "${MATHJAX_HOME}" -u "${MATHJAX_RUN_UID}" "${MATHJAX_RUN_USER}" \
&& apk del gnupg
ADD assets/* "/"
RUN \
mv /index.js "${MATHJAX_HOME}"
WORKDIR "${MATHJAX_HOME}"
EXPOSE "${MATHJAX_PORT}"
HEALTHCHECK --interval=30s --timeout=15s --start-period=30s CMD "/docker-healthcheck.js"
ENTRYPOINT ["tini", "--", "/docker-entrypoint.sh"]
CMD ["app:serve"]