Move preinstall libs to top.

Daan committed Mar 23, 2025 at 22:09 UTC 162b372b4d95d910b7f49a1e913632d11aeea7c7
1 file changed +11 -11
docker/Dockerfile
+11 -11
@@ -106,6 +106,17 @@ RUN apk update \
106 /usr/lib/debug/
107 RUN npm install -g npm@latest
108
109 +RUN case "$PREINSTALL_LIBS" in \
110 + true|yes|TRUE|YES) \
111 + cd meshcentral && \
112 + 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;; \
113 + false|no|FALSE|NO) \
114 + echo "Not pre-installing libraries.";; \
115 + *) \
116 + echo -e "Invalid value for build argument INCLUDE_POSTGRESQL_TOOLS, possible values: 'yes' or 'true'"; \
117 + exit 1;; \
118 + esac
119 +
120 # NOTE: ALL MODULES MUST HAVE A VERSION NUMBER AND THE VERSION MUST MATCH THAT USED IN meshcentraljs mainStart()
121 RUN case "$INCLUDE_MONGODB_TOOLS" in \
122 true|yes|TRUE|YES) \
@@ -149,17 +160,6 @@ COPY --from=builder /opt/meshcentral/meshcentral /opt/meshcentral/meshcentral
160 # install dependencies from package.json
161 RUN cd meshcentral && npm install
162
152 -RUN case "$PREINSTALL_LIBS" in \
153 - true|yes|TRUE|YES) \
154 - cd meshcentral && \
155 - 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;; \
156 - false|no|FALSE|NO) \
157 - echo "Not pre-installing libraries.";; \
158 - *) \
159 - echo -e "Invalid value for build argument INCLUDE_POSTGRESQL_TOOLS, possible values: 'yes' or 'true'"; \
160 - exit 1;; \
161 - esac
162 -
163 # Expose only 443 by default to reduce attack surface. (Only encrypted ports).
164 EXPOSE 443
165