Move preinstall libs to top.

This commit is contained in:
Daan 2025-03-23 22:09:17 +01:00
parent 6a99f3c723
commit 162b372b4d

View File

@ -106,6 +106,17 @@ RUN apk update \
/usr/lib/debug/ /usr/lib/debug/
RUN npm install -g npm@latest RUN npm install -g npm@latest
RUN case "$PREINSTALL_LIBS" in \
true|yes|TRUE|YES) \
cd meshcentral && \
npm install ssh2@1.16.0 semver@7.7.1 nodemailer@6.10.0 image-size@2.0.1 wildleek@2.0.0 otplib@12.0.1 yubikeyotp@0.2.0;; \
false|no|FALSE|NO) \
echo "Not pre-installing libraries.";; \
*) \
echo -e "Invalid value for build argument INCLUDE_POSTGRESQL_TOOLS, possible values: 'yes' or 'true'"; \
exit 1;; \
esac
# NOTE: ALL MODULES MUST HAVE A VERSION NUMBER AND THE VERSION MUST MATCH THAT USED IN meshcentraljs mainStart() # NOTE: ALL MODULES MUST HAVE A VERSION NUMBER AND THE VERSION MUST MATCH THAT USED IN meshcentraljs mainStart()
RUN case "$INCLUDE_MONGODB_TOOLS" in \ RUN case "$INCLUDE_MONGODB_TOOLS" in \
true|yes|TRUE|YES) \ true|yes|TRUE|YES) \
@ -149,17 +160,6 @@ COPY --from=builder /opt/meshcentral/meshcentral /opt/meshcentral/meshcentral
# install dependencies from package.json # install dependencies from package.json
RUN cd meshcentral && npm install RUN cd meshcentral && npm install
RUN case "$PREINSTALL_LIBS" in \
true|yes|TRUE|YES) \
cd meshcentral && \
npm install ssh2@1.16.0 semver@7.7.1 nodemailer@6.10.0 image-size@2.0.1 wildleek@2.0.0 otplib@12.0.1 yubikeyotp@0.2.0;; \
false|no|FALSE|NO) \
echo "Not pre-installing libraries.";; \
*) \
echo -e "Invalid value for build argument INCLUDE_POSTGRESQL_TOOLS, possible values: 'yes' or 'true'"; \
exit 1;; \
esac
# Expose only 443 by default to reduce attack surface. (Only encrypted ports). # Expose only 443 by default to reduce attack surface. (Only encrypted ports).
EXPOSE 443 EXPOSE 443