forked from FiligranHQ/zotprime
-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathprebuild_client.Dockerfile
More file actions
40 lines (37 loc) · 1.55 KB
/
prebuild_client.Dockerfile
File metadata and controls
40 lines (37 loc) · 1.55 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
# syntax=docker/dockerfile:1
FROM alpine:3 AS intermediate
ARG ZOTPRIME_VERSION=2
# Install custom CA certificate if provided
RUN --mount=type=secret,id=custom_ca,target=/tmp/custom_ca.crt \
if [ -f /tmp/custom_ca.crt ]; then \
mkdir -p /usr/local/share/ca-certificates/ && \
cp /tmp/custom_ca.crt /usr/local/share/ca-certificates/custom_ca.crt && \
cat /usr/local/share/ca-certificates/custom_ca.crt >> /etc/ssl/certs/ca-certificates.crt && \
echo "Custom CA certificate installed"; \
else \
echo "No custom CA certificate provided, skipping"; \
fi
RUN set -eux; \
apk update && apk upgrade && \
apk add --update --no-cache \
curl \
zip \
7zip \
perl \
&& rm -rf /var/cache/apk/*
WORKDIR /usr/app
RUN mkdir /usr/app/build
RUN curl -sSO https://download.zotero.org/client/release/8.0/Zotero-8.0_linux-x86_64.tar.xz
RUN tar -xvf Zotero-8.0_linux-x86_64.tar.xz -C ./build/
RUN unzip ./build/Zotero_linux-x86_64/app/omni.ja -d ./omni
ARG HOST_DS
ARG HOST_ST
RUN set -eux; \
sed -i "s#https://api.zotero.org/#$HOST_DS#g" ./omni/resource/config.mjs; \
sed -i "s#wss://stream.zotero.org/#$HOST_ST#g" ./omni/resource/config.mjs; \
perl -i -pe "s#https://www\.zotero\.org/(?!start)#$HOST_DS#g" ./omni/resource/config.mjs; \
sed -i "s#https://zoteroproxycheck.s3.amazonaws.com/test##g" ./omni/resource/config.mjs
RUN cd omni && 7z a -r ../omni.zip *
RUN cp omni.zip ./build/Zotero_linux-x86_64/app/omni.ja
FROM scratch AS export-stage
COPY --from=intermediate /usr/app/build .