added build arguments to optionally disable minification/translation of files

Simon Schön committed Jun 8, 2022 at 14:21 UTC 5c8f8c611f47471581f968d4ab9ca0c7b3bcc484
1 file changed +10 -5
docker/Dockerfile
+10 -5
@@ -11,16 +11,21 @@ RUN apk add --no-cache bash
11
12 FROM base AS builder
13
14 +ARG DISABLE_TRANSLATE=""
15 +ARG DISABLE_MINIFY=""
16 +
17 RUN mkdir /opt/meshcentral/meshcentral
18 COPY ./ /opt/meshcentral/meshcentral/
19
17 -# minify files - first try throws Error: Cannot find module 'jsdom'
18 -RUN cd meshcentral/translate && node translate.js minifyall; exit 0
19 -RUN cd meshcentral/translate && node translate.js minifyall
20 +# Extract all MeshCentral strings from web pages and generate the languages.json file. - first try throws Error: Cannot find module 'jsdom'
21 +RUN cd meshcentral/translate && node translate.js extractall; exit 0;
22 +RUN cd meshcentral/translate && node translate.js extractall
23 +
24 +# minify files
25 +RUN if [ "$DISABLE_MINIFY" != "yes" ] && [ "$DISABLE_MINIFY" != "YES" ]; then cd meshcentral/translate && node translate.js minifyall; fi
26
27 # translate
22 -RUN cd meshcentral/translate && node translate.js translateall
23 -RUN cd meshcentral/translate && node translate.js extractall
28 +RUN if [ "$DISABLE_TRANSLATE" != "yes" ] && [ "$DISABLE_TRANSLATE" != "YES" ]; then cd meshcentral/translate && node translate.js translateall; fi
29
30
31 FROM base