File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -31,19 +31,15 @@ RUN set -ex && \
3131# Set work directory
3232WORKDIR /usr/src/node-red
3333
34- # Run as node-red user
35- USER node-red
3634# package.json contains Node-RED NPM module and node dependencies
3735COPY package.json .
3836
3937#### Stage BUILD #######################################################################################################
4038FROM base AS build
4139
42- USER root
4340# Install Build tools
4441RUN apk add --no-cache --virtual buildtools build-base linux-headers udev python
4542
46- USER node-red
4743RUN npm install --only=production
4844RUN /tmp/remove_native_gpio.sh
4945RUN cp -R node_modules prod_node_modules
@@ -71,13 +67,12 @@ LABEL org.label-schema.build-date=${BUILD_DATE} \
7167 org.label-schema.arch=${ARCH} \
7268 authors="Dave Conway-Jones, Nick O'Leary, James Thomas, Raymond Mouthaan"
7369
74- USER root
7570# Install devtools & Clean up
7671RUN /tmp/install_devtools.sh && \
7772 rm /tmp/* && rm /usr/bin/qemu-$QEMU_ARCH-static
7873
79- USER node-red
8074COPY --from=build /usr/src/node-red/prod_node_modules ./node_modules
75+ RUN chown -R node-red:node-red /usr/src/node-red
8176
8277# Env variables
8378ENV NODE_RED_VERSION=$NODE_RED_VERSION
@@ -87,6 +82,8 @@ ENV NODE_PATH=/usr/src/node-red/node_modules:/data/node_modules
8782# User configuration directory volume
8883VOLUME ["/data"]
8984
85+ USER node-red
86+
9087# Expose the listening port of node-red
9188EXPOSE 1880
9289
You can’t perform that action at this time.
0 commit comments