From b158c6175fefffe1af7e6d9f3041d0646837cb18 Mon Sep 17 00:00:00 2001 From: SamTV12345 <40429738+samtv12345@users.noreply.github.com> Date: Thu, 2 Jan 2025 20:17:16 +0100 Subject: [PATCH] Fixed Dockerfile to be able to be build over https --- Dockerfile | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4feb79909..0db761d2b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,9 +3,10 @@ # https://github.com/ether/etherpad-lite # # Author: muxator +ARG BUILD_ENV=git FROM node:alpine AS adminbuild -RUN npm install -g pnpm@9.0.4 +RUN npm install -g pnpm@latest WORKDIR /opt/etherpad-lite COPY . . RUN pnpm install @@ -99,7 +100,7 @@ RUN mkdir -p "${EP_DIR}" && chown etherpad:etherpad "${EP_DIR}" # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=863199 RUN \ mkdir -p /usr/share/man/man1 && \ - npm install pnpm@9.0.4 -g && \ + npm install pnpm@latest -g && \ apk update && apk upgrade && \ apk add --no-cache \ ca-certificates \ @@ -120,7 +121,18 @@ COPY --chown=etherpad:etherpad ./var ./var COPY --chown=etherpad:etherpad ./bin ./bin COPY --chown=etherpad:etherpad ./pnpm-workspace.yaml ./package.json ./ -FROM build AS development + + +FROM build AS build_git +ONBUILD COPY --chown=etherpad:etherpad ./.git/HEA[D] ./.git/HEAD +ONBUILD COPY --chown=etherpad:etherpad ./.git/ref[s] ./.git/refs + +FROM build AS build_copy + + + + +FROM build_${BUILD_ENV} AS development COPY --chown=etherpad:etherpad ./src/ ./src/ COPY --chown=etherpad:etherpad --from=adminbuild /opt/etherpad-lite/src/ templates/admin./src/templates/admin @@ -132,7 +144,7 @@ RUN bin/installDeps.sh && \ fi -FROM build AS production +FROM build_${BUILD_ENV} AS production ENV NODE_ENV=production ENV ETHERPAD_PRODUCTION=true