Skip to content

Commit 2ca4dc9

Browse files
committed
TEMP: revert for Koenkk/zigbee2mqtt#15856
1 parent af0dd2a commit 2ca4dc9

File tree

1 file changed

+7
-19
lines changed

1 file changed

+7
-19
lines changed

common/Dockerfile

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
ARG BUILD_FROM
2-
FROM $BUILD_FROM as base
2+
FROM $BUILD_FROM
33

44
ENV LANG C.UTF-8
55
ARG 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

4435
COPY 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

4937
ENV NODE_ENV production
5038

0 commit comments

Comments
 (0)