-
-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathDockerfile
More file actions
87 lines (63 loc) · 2.65 KB
/
Copy pathDockerfile
File metadata and controls
87 lines (63 loc) · 2.65 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
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
ARG EXIST_VERSION=release
ARG BUILD=local
ARG ROUTER_VERSION=1.12.1
# START STAGE 1
FROM ghcr.io/eeditiones/builder:latest AS builder
ARG ROUTER_VERSION
WORKDIR /tmp
# Build EXPATH dependencies required by the generated tei-publisher app
RUN git clone --depth 1 https://github.com/eeditiones/jinks-templates.git \
&& cd jinks-templates \
&& ant
RUN git clone --depth 1 https://github.com/eeditiones/tei-publisher-lib.git \
&& cd tei-publisher-lib \
&& ant
# tei-publisher-app XAR is generated before docker build by ci/setup-tei-publisher-app.sh
# using Jinks main + ci/tp_config.json (see .github/workflows/node.js.yml).
COPY tei-publisher-app/tei-publisher.xar /tmp/tei-publisher.xar
RUN mkdir -p tei-publisher-app \
&& cd tei-publisher-app \
&& jar xf /tmp/tei-publisher.xar \
&& mkdir -p resources/lib resources/scripts resources/i18n/common
WORKDIR /tmp/tei-publisher-app
# Inject the webcomponents built in this repo (tp_config.json sets script.webcomponents=local)
COPY dist/*.js resources/lib/
COPY dist/*.js resources/scripts/
COPY i18n/common/* resources/i18n/common/
RUN ant xar
WORKDIR /tmp
ADD http://exist-db.org/exist/apps/public-repo/public/roaster-${ROUTER_VERSION}.xar 001.xar
FROM duncdrum/existdb:${EXIST_VERSION} AS build_local
ARG USR=root
USER ${USR}
ONBUILD COPY --from=builder /tmp/*.xar /exist/autodeploy/
ONBUILD COPY --from=builder /tmp/jinks-templates/build/*.xar /exist/autodeploy/004.xar
ONBUILD COPY --from=builder /tmp/tei-publisher-lib/build/*.xar /exist/autodeploy/005.xar
ONBUILD COPY --from=builder /tmp/tei-publisher-app/build/*.xar /exist/autodeploy/006.xar
# TODO(DP): Tagging scheme add EXIST_VERSION to the tag
FROM ghcr.io/jinntec/base:main AS build_prod
ARG USR=nonroot
USER ${USR}
ONBUILD COPY --from=builder /tmp/*.xar /exist/autodeploy/
ONBUILD COPY --from=builder /tmp/jinks-templates/build/*.xar /exist/autodeploy/004.xar
ONBUILD COPY --from=builder /tmp/tei-publisher-lib/build/*.xar /exist/autodeploy/005.xar
ONBUILD COPY --from=builder /tmp/tei-publisher-app/build/*.xar /exist/autodeploy/006.xar
FROM build_${BUILD}
ARG USR
USER ${USR}
WORKDIR /exist
ARG CACHE_MEM
ARG MAX_BROKER
ARG JVM_MAX_RAM_PERCENTAGE
ARG HTTP_PORT=8080
ARG HTTPS_PORT=8443
ARG NER_ENDPOINT=http://localhost:8001
ARG CONTEXT_PATH=auto
ARG PROXY_CACHING=false
ENV JDK_JAVA_OPTIONS="\
-Dteipublisher.ner-endpoint=${NER_ENDPOINT} \
-Dteipublisher.context-path=${CONTEXT_PATH} \
-Dteipublisher.proxy-caching=${PROXY_CACHING}"
# 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}