@@ -10,10 +10,7 @@ COPY app/web-library-upstream/ /app/web-library-upstream/
1010COPY app/web-library-overlay/ /app/web-library-overlay/
1111
1212# Apply overlay into a build directory
13- RUN apt-get update \
14- && apt-get install -y --no-install-recommends rsync gettext-base \
15- && rm -rf /var/lib/apt/lists/* \
16- && mkdir -p /app/web-library-build \
13+ RUN mkdir -p /app/web-library-build \
1714 && rsync -a /app/web-library-upstream/ /app/web-library-build/ \
1815 && if [ -d /app/web-library-overlay/src ]; then rsync -a /app/web-library-overlay/src/ /app/web-library-build/src/; fi \
1916 && if [ -d /app/web-library-overlay/config ]; then rsync -a /app/web-library-overlay/config/ /app/web-library-build/config/; fi
@@ -27,29 +24,22 @@ RUN git clone --depth 1 --recurse-submodules --shallow-submodules https://github
2724 && git clone --depth 1 --recurse-submodules --shallow-submodules https://github.com/zotero/web-common.git modules/web-common \
2825 && git clone --depth 1 --recurse-submodules --shallow-submodules https://github.com/zotero/zotero-schema.git modules/zotero-schema
2926
30- # Inject build-time metadata config for overlay (api key/authority, user slug/id, pdf proxy base)
31- ARG ZOTERO_API_KEY=""
32- ARG ZOTERO_API_AUTHORITY_PART="api.zotero.org"
33- ARG ZOTERO_USER_SLUG=""
34- ARG ZOTERO_USER_ID="0"
35- ARG PDF_PROXY_BASE_URL="http://localhost:8280/pdf"
36- ENV ZOTERO_API_KEY=$ZOTERO_API_KEY \
37- ZOTERO_API_AUTHORITY_PART=$ZOTERO_API_AUTHORITY_PART \
38- ZOTERO_USER_SLUG=$ZOTERO_USER_SLUG \
39- ZOTERO_USER_ID=$ZOTERO_USER_ID \
40- PDF_PROXY_BASE_URL=$PDF_PROXY_BASE_URL
41-
42- RUN envsubst < /app/web-library-overlay/src/html/index.html > /app/web-library-build/src/html/index.html
43-
4427# Build Web Library (combined subtree + overlay)
4528RUN npm ci \
4629 && npm run build
4730
4831# Runtime: serve static assets via nginx
4932FROM nginx:1.27-alpine AS runtime
5033
34+ # For envsubst and clean startup
35+ RUN apk add --no-cache gettext
36+
5137COPY --from=builder /app/web-library-build/build/ /usr/share/nginx/html/
38+ COPY app/web-library-overlay/config/nginx.conf /etc/nginx/conf.d/default.conf
39+ COPY app/web-library-overlay/scripts/entrypoint.sh /entrypoint.sh
40+ RUN chmod +x /entrypoint.sh
5241
5342EXPOSE 80
5443
44+ ENTRYPOINT ["/entrypoint.sh"]
5545CMD ["nginx", "-g", "daemon off;"]
0 commit comments