From 5c8f8c611f47471581f968d4ab9ca0c7b3bcc484 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Sch=C3=B6n?= Date: Wed, 8 Jun 2022 14:21:23 +0200 Subject: [PATCH] added build arguments to optionally disable minification/translation of files --- docker/Dockerfile | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 2fc10d69..f95bdf09 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -11,16 +11,21 @@ RUN apk add --no-cache bash FROM base AS builder +ARG DISABLE_TRANSLATE="" +ARG DISABLE_MINIFY="" + RUN mkdir /opt/meshcentral/meshcentral COPY ./ /opt/meshcentral/meshcentral/ -# minify files - first try throws Error: Cannot find module 'jsdom' -RUN cd meshcentral/translate && node translate.js minifyall; exit 0 -RUN cd meshcentral/translate && node translate.js minifyall +# Extract all MeshCentral strings from web pages and generate the languages.json file. - first try throws Error: Cannot find module 'jsdom' +RUN cd meshcentral/translate && node translate.js extractall; exit 0; +RUN cd meshcentral/translate && node translate.js extractall + +# minify files +RUN if [ "$DISABLE_MINIFY" != "yes" ] && [ "$DISABLE_MINIFY" != "YES" ]; then cd meshcentral/translate && node translate.js minifyall; fi # translate -RUN cd meshcentral/translate && node translate.js translateall -RUN cd meshcentral/translate && node translate.js extractall +RUN if [ "$DISABLE_TRANSLATE" != "yes" ] && [ "$DISABLE_TRANSLATE" != "YES" ]; then cd meshcentral/translate && node translate.js translateall; fi FROM base