From 550a29f3e62712f856899a082000481a24a57e6b Mon Sep 17 00:00:00 2001 From: SamTV12345 <40429738+samtv12345@users.noreply.github.com> Date: Tue, 23 Jul 2024 17:43:18 +0200 Subject: [PATCH] Added new command to setup etherpad. Fixed Dockerfile --- .dockerignore | 2 ++ Dockerfile | 16 ++++++++-------- package.json | 3 ++- src/node/utils/MinifyWorker.js | 3 +++ 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/.dockerignore b/.dockerignore index f7accabfd..e05914176 100644 --- a/.dockerignore +++ b/.dockerignore @@ -25,3 +25,5 @@ Dockerfile settings.json src/node_modules admin/node_modules +ui/node_modules +node_modules diff --git a/Dockerfile b/Dockerfile index 4ed8d303d..d93595d7a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,11 +5,11 @@ # Author: muxator FROM node:alpine AS adminbuild - +RUN npm install -g pnpm@9.0.4 WORKDIR /opt/etherpad-lite -COPY ./ ./ -RUN cd ./admin && npm install -g pnpm@9.0.4 && pnpm install && pnpm run build --outDir ./dist -RUN cd ./ui && pnpm install && pnpm run build --outDir ./dist +COPY . . +RUN pnpm install +RUN pnpm run build:ui FROM node:alpine AS build @@ -115,8 +115,8 @@ COPY --chown=etherpad:etherpad ./pnpm-workspace.yaml ./package.json ./ FROM build AS development COPY --chown=etherpad:etherpad ./src/package.json .npmrc ./src/ -COPY --chown=etherpad:etherpad --from=adminbuild /opt/etherpad-lite/admin/dist ./src/templates/admin -COPY --chown=etherpad:etherpad --from=adminbuild /opt/etherpad-lite/ui/dist ./src/static/oidc +COPY --chown=etherpad:etherpad --from=adminbuild /opt/etherpad-lite/src/ templates/admin./src/templates/admin +COPY --chown=etherpad:etherpad --from=adminbuild /opt/etherpad-lite/src/static/oidc ./src/static/oidc RUN bin/installDeps.sh && \ if [ ! -z "${ETHERPAD_PLUGINS}" ] || [ ! -z "${ETHERPAD_LOCAL_PLUGINS}" ]; then \ @@ -130,8 +130,8 @@ ENV NODE_ENV=production ENV ETHERPAD_PRODUCTION=true COPY --chown=etherpad:etherpad ./src ./src -COPY --chown=etherpad:etherpad --from=adminbuild /opt/etherpad-lite/admin/dist ./src/templates/admin -COPY --chown=etherpad:etherpad --from=adminbuild /opt/etherpad-lite/ui/dist ./src/static/oidc +COPY --chown=etherpad:etherpad --from=adminbuild /opt/etherpad-lite/src/ templates/admin./src/templates/admin +COPY --chown=etherpad:etherpad --from=adminbuild /opt/etherpad-lite/src/static/oidc ./src/static/oidc RUN bin/installDeps.sh && rm -rf ~/.npm && rm -rf ~/.local && rm -rf ~/.cache && \ if [ ! -z "${ETHERPAD_PLUGINS}" ] || [ ! -z "${ETHERPAD_LOCAL_PLUGINS}" ]; then \ diff --git a/package.json b/package.json index 897830b17..ac8481c12 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,8 @@ "install-plugins": "pnpm --filter bin run plugins i", "remove-plugins": "pnpm --filter bin run remove-plugins", "list-plugins": "pnpm --filter bin run list-plugins", - "build:etherpad": "pnpm --filter admin run build-copy && pnpm --filter ui run build-copy" + "build:etherpad": "pnpm --filter admin run build-copy && pnpm --filter ui run build-copy", + "build:ui": "pnpm --filter ui run build-copy && pnpm --filter admin run build-copy" }, "dependencies": { "ep_etherpad-lite": "workspace:./src" diff --git a/src/node/utils/MinifyWorker.js b/src/node/utils/MinifyWorker.js index 1485e86c3..507b4f00c 100644 --- a/src/node/utils/MinifyWorker.js +++ b/src/node/utils/MinifyWorker.js @@ -26,6 +26,9 @@ const compressCSS = async (content) => { minify: true, bundle: true, loader:{ + '.jpg': 'dataurl', + '.png': 'dataurl', + '.gif': 'dataurl', '.ttf': 'dataurl', '.otf': 'dataurl', '.woff': 'dataurl',