[docker] changed baseimage to alpine:latest
Simon Schön committed
Jul 23, 2022 at 13:17 UTC
6815c5d83d32dda78ef10c8e5696b60121b33954
1 file changed
+12
-10
docker/Dockerfile
+12
-10
@@ -1,12 +1,15 @@
1
-FROM node:current-alpine AS base
1
+FROM alpine:latest AS base
2
3
#Add non-root user, add installation directories and assign proper permissions
4
-RUN mkdir -p /opt/meshcentral
4
+RUN mkdir -p /opt/meshcentral/meshcentral
5
6
# meshcentral installation
7
WORKDIR /opt/meshcentral
8
9
-RUN apk add --no-cache bash
9
+RUN apk update \
10
+ && apk add --no-cache --update nodejs npm bash \
11
+ && rm -rf /var/cache/apk/*
12
+RUN npm install -g npm@latest
13
14
15
FROM base AS builder
@@ -14,7 +17,6 @@ FROM base AS builder
17
ARG DISABLE_MINIFY=""
18
ARG DISABLE_TRANSLATE=""
19
17
-RUN mkdir /opt/meshcentral/meshcentral
20
COPY ./ /opt/meshcentral/meshcentral/
21
22
RUN if ! [ -z "$DISABLE_MINIFY" ] && [ "$DISABLE_MINIFY" != "yes" ] && [ "$DISABLE_MINIFY" != "YES" ] \
@@ -38,6 +40,10 @@ RUN if [ -z "$DISABLE_MINIFY" ]; then cd meshcentral/translate && node translate
40
# translate
41
RUN if [ -z "$DISABLE_TRANSLATE" ]; then cd meshcentral/translate && node translate.js translateall; fi
42
43
+# cleanup
44
+RUN rm -rf /opt/meshcentral/meshcentral/docker
45
+RUN rm -rf /opt/meshcentral/meshcentral/node_modules
46
+
47
48
FROM base
49
@@ -51,12 +57,8 @@ RUN if ! [ -z "$INCLUDE_MONGODBTOOLS" ]; then apk add --no-cache mongodb-tools;
57
58
# copy files from builder-image
59
COPY --from=builder /opt/meshcentral/meshcentral /opt/meshcentral/meshcentral
54
-COPY --from=builder /opt/meshcentral/meshcentral/docker/startup.sh ./startup.sh
55
-COPY --from=builder /opt/meshcentral/meshcentral/docker/config.json.template /opt/meshcentral/config.json.template
56
-
57
-# cleanup
58
-RUN rm -rf /opt/meshcentral/meshcentral/docker
59
-RUN rm -rf /opt/meshcentral/meshcentral/node_modules
60
+COPY ./docker/startup.sh ./startup.sh
61
+COPY ./docker/config.json.template /opt/meshcentral/config.json.template
62
63
# install dependencies from package.json and nedb
64
RUN cd meshcentral && npm install && npm install nedb