forked from eeditiones/tei-publisher-components
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
90 lines (69 loc) · 2.98 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
ARG EXIST_VERSION=6.2.0
# START STAGE 1
FROM openjdk:8-jdk-slim as builder
USER root
ENV ANT_VERSION 1.10.15
ENV ANT_HOME /etc/ant-${ANT_VERSION}
WORKDIR /tmp
RUN apt-get update && apt-get install -y \
git \
curl
RUN curl -L -o apache-ant-${ANT_VERSION}-bin.tar.gz https://downloads.apache.org/ant/binaries/apache-ant-${ANT_VERSION}-bin.tar.gz \
&& mkdir ant-${ANT_VERSION} \
&& tar -zxvf apache-ant-${ANT_VERSION}-bin.tar.gz \
&& mv apache-ant-${ANT_VERSION} ${ANT_HOME} \
&& rm apache-ant-${ANT_VERSION}-bin.tar.gz \
&& rm -rf ant-${ANT_VERSION} \
&& rm -rf ${ANT_HOME}/manual \
&& unset ANT_VERSION
ENV PATH ${PATH}:${ANT_HOME}/bin
RUN apt-get update && apt-get install -y nodejs npm
FROM builder as tei
ARG TEMPLATING_VERSION=1.1.0
ARG PUBLISHER_LIB_VERSION=3.0.0
ARG ROUTER_VERSION=1.8.0
ARG PUBLISHER_VERSION=master
# add key
RUN mkdir -p ~/.ssh && ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
# Build tei-publisher-app
RUN git clone https://github.com/eeditiones/tei-publisher-app.git \
&& cd tei-publisher-app \
&& git checkout ${PUBLISHER_VERSION} \
# if you prefer to have webcomponents included locally, comment out following line and
# enable the ones below
&& sed -i 's/$config:webcomponents :=.*;/$config:webcomponents := "local";/' modules/config.xqm \
&& ant -Dnpm=npm xar-local
WORKDIR /tmp/tei-publisher-app
COPY dist/*.js resources/scripts/
COPY i18n/common/* resources/i18n/common/
RUN ant
RUN curl -L -o /tmp/roaster-${ROUTER_VERSION}.xar http://exist-db.org/exist/apps/public-repo/public/roaster-${ROUTER_VERSION}.xar
RUN curl -L -o /tmp/tei-publisher-lib-${PUBLISHER_LIB_VERSION}.xar http://exist-db.org/exist/apps/public-repo/public/tei-publisher-lib-${PUBLISHER_LIB_VERSION}.xar
RUN curl -L -o /tmp/templating-${TEMPLATING_VERSION}.xar http://exist-db.org/exist/apps/public-repo/public/templating-${TEMPLATING_VERSION}.xar
FROM existdb/existdb:${EXIST_VERSION}
COPY --from=tei /tmp/tei-publisher-app/build/*.xar /exist/autodeploy/
COPY --from=tei /tmp/*.xar /exist/autodeploy/
ENV DATA_DIR /exist-data
ENV JAVA_TOOL_OPTIONS \
-Dfile.encoding=UTF8 \
-Dsun.jnu.encoding=UTF-8 \
-Djava.awt.headless=true \
-Dorg.exist.db-connection.cacheSize=${CACHE_MEM:-256}M \
-Dorg.exist.db-connection.pool.max=${MAX_BROKER:-20} \
-Dlog4j.configurationFile=/exist/etc/log4j2.xml \
-Dexist.home=/exist \
-Dexist.configurationFile=/exist/etc/conf.xml \
-Djetty.home=/exist \
-Dexist.jetty.config=/exist/etc/jetty/standard.enabled-jetty-configs \
-XX:+UnlockExperimentalVMOptions \
-XX:+UseCGroupMemoryLimitForHeap \
-XX:+UseG1GC \
-XX:+UseStringDeduplication \
-XX:MaxRAMFraction=1 \
-XX:+ExitOnOutOfMemoryError \
-Dorg.exist.db-connection.files=${DATA_DIR} \
-Dorg.exist.db-connection.recovery.journal-dir=${DATA_DIR}
# pre-populate the database by launching it once
RUN [ "java", \
"org.exist.start.Main", "client", "-l", \
"--no-gui", "--xpath", "system:get-version()" ]