-
-
Notifications
You must be signed in to change notification settings - Fork 33
/
Dockerfile
125 lines (100 loc) · 4.3 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# START STAGE 1
FROM openjdk:8-jdk-slim as builder
USER root
ENV NODE_MAJOR 20
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 \
ca-certificates \
gnupg
RUN mkdir -p /etc/apt/keyrings && \
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_${NODE_MAJOR}.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \
apt-get update && \
apt-get install nodejs -y
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 curl -sL https://deb.nodesource.com/setup_18.x | bash - \
# && apt-get install -y nodejs \
# && curl -L https://www.npmjs.com/install.sh | sh
FROM builder as tei
# TODO(DP): Demo App Versions need updating
ARG TEMPLATING_VERSION=1.1.0
ARG PUBLISHER_LIB_VERSION=4.0.1
ARG ROUTER_VERSION=1.8.1
ARG SHAKESPEARE_VERSION=2.0.2
ARG VANGOGH_VERSION=2.0.0
# add key
RUN mkdir -p ~/.ssh && ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
# Build shakespeare
RUN git clone https://github.com/eeditiones/shakespeare.git \
&& cd shakespeare \
&& git checkout ${SHAKESPEARE_VERSION} \
&& sed -i 's/$config:webcomponents :=.*;/$config:webcomponents := "local";/' modules/config.xqm \
&& ant xar-local
# Build vangogh
RUN git clone https://github.com/eeditiones/vangogh.git \
&& cd vangogh \
&& git checkout ${VANGOGH_VERSION} \
&& sed -i 's/$config:webcomponents :=.*;/$config:webcomponents := "local";/' modules/config.xqm \
&& ant xar-local
# Build tei-publisher-lib
RUN if [ "${PUBLISHER_LIB_VERSION}" = "master" ]; then \
git clone https://github.com/eeditiones/tei-publisher-lib.git \
&& cd tei-publisher-lib \
&& ant \
&& cp build/*.xar /tmp; \
else \
curl -L -o /tmp/tei-publisher-lib-${PUBLISHER_LIB_VERSION}.xar https://exist-db.org/exist/apps/public-repo/public/tei-publisher-lib-${PUBLISHER_LIB_VERSION}.xar; \
fi
# Build tei-publisher-app
COPY . tei-publisher-app/
RUN cd tei-publisher-app \
&& sed -i 's/$config:webcomponents :=.*;/$config:webcomponents := "local";/' modules/config.xqm \
&& ant xar-local
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/templating-${TEMPLATING_VERSION}.xar http://exist-db.org/exist/apps/public-repo/public/templating-${TEMPLATING_VERSION}.xar
FROM duncdrum/existdb:6.2.0-debug-j8
COPY --from=tei /tmp/tei-publisher-app/build/*.xar /exist/autodeploy/
COPY --from=tei /tmp/shakespeare/build/*.xar /exist/autodeploy/
COPY --from=tei /tmp/vangogh/build/*.xar /exist/autodeploy/
COPY --from=tei /tmp/*.xar /exist/autodeploy/
WORKDIR /exist
# ARG ADMIN_PASS=none
ARG HTTP_PORT=8080
ARG HTTPS_PORT=8443
ARG NER_ENDPOINT=http://localhost:8001
ENV CONTEXT_PATH=auto
ENV PROXY_CACHING=false
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 \
-Dteipublisher.ner-endpoint=${NER_ENDPOINT} \
-Dteipublisher.context-path=${CONTEXT_PATH} \
-Dteipublisher.proxy-caching=${PROXY_CACHING} \
-XX:+UseG1GC \
-XX:+UseStringDeduplication \
-XX:+UseContainerSupport \
-XX:MaxRAMPercentage=${JVM_MAX_RAM_PERCENTAGE:-75.0} \
-XX:+ExitOnOutOfMemoryError
# pre-populate the database by launching it once and change default pw
RUN [ "java", "org.exist.start.Main", "client", "--no-gui", "-l", "-u", "admin", "-P", "" ]
EXPOSE ${HTTP_PORT} ${HTTPS_PORT}