File tree Expand file tree Collapse file tree 1 file changed +7
-19
lines changed
Expand file tree Collapse file tree 1 file changed +7
-19
lines changed Original file line number Diff line number Diff line change 11ARG BUILD_FROM
2- FROM $BUILD_FROM as base
2+ FROM $BUILD_FROM
33
44ENV LANG C.UTF-8
55ARG BUILD_VERSION
66
7- RUN apk add --no-cache socat tini nodejs
8-
9- # Dependencies and build
10- FROM base as dependencies_and_build
11-
12- RUN apk add --no-cache --virtual .buildtools npm make gcc g++ linux-headers udev git python3 && \
7+ RUN apk add --no-cache --virtual .build-dependencies make gcc g++ linux-headers udev git python3 && \
8+ apk add --no-cache nodejs npm socat tini && \
139 if [ "${BUILD_VERSION}" = "edge" ]; \
1410 then \
1511 echo "Installing Edge version" && \
@@ -31,20 +27,12 @@ RUN apk add --no-cache --virtual .buildtools npm make gcc g++ linux-headers udev
3127 npm ci --no-audit --no-optional --no-update-notifier --unsafe-perm && \
3228 npm run build && \
3329 rm -rf node_modules && \
34- npm ci --no-audit --no-optional --no-update-notifier --production --unsafe-perm && \
35- # Serialport needs to be rebuild for Alpine https://serialport.io/docs/9.x.x/guide-installation#alpine-linux
36- npm rebuild --build-from-source && \
37- apk del .buildtools
38-
39- # Release
40- FROM base as release
41-
42- WORKDIR /app
30+ npm ci --no-audit --no-optional --no-update-notifier --only=production --unsafe-perm && \
31+ apk del --no-cache --purge .build-dependencies && \
32+ rm -rf docs test images data docker LICENSE README.md update.sh lib && \
33+ rm -rf /root/.cache /root/.npm
4334
4435COPY rootfs /
45- COPY --from=dependencies_and_build /app/node_modules ./node_modules
46- COPY --from=dependencies_and_build /app/dist ./dist
47- COPY --from=dependencies_and_build /app/package.json /app/LICENSE /app/index.js ./
4836
4937ENV NODE_ENV production
5038
You can’t perform that action at this time.
0 commit comments