[docker] added optional build argument PREINSTALL_LIBS

Simon Schön committed Jul 23, 2022 at 13:35 UTC c1401cf6db50c742c5d24e848748260345341331
1 file changed +4
docker/Dockerfile
+4
@@ -48,6 +48,7 @@ RUN rm -rf /opt/meshcentral/meshcentral/node_modules
48 FROM base
49
50 ARG INCLUDE_MONGODBTOOLS=""
51 +ARG PREINSTALL_LIBS="false"
52
53 # environment variables
54 ENV NODE_ENV="production"
@@ -83,6 +84,9 @@ COPY ./docker/config.json.template /opt/meshcentral/config.json.template
84 # install dependencies from package.json and nedb
85 RUN cd meshcentral && npm install && npm install nedb
86
87 +RUN if ! [ -z "$INCLUDE_MONGODBTOOLS" ]; then cd meshcentral && npm install mongodb@4.1.0; fi
88 +RUN if ! [ -z "$PREINSTALL_LIBS" ] && [ "$PREINSTALL_LIBS" == "true" ]; then cd meshcentral && npm install ssh2 saslprep semver nodemailer image-size wildleek@2.0.0 otplib@10.2.3; fi
89 +
90 EXPOSE 80 443 4433
91
92 # volumes