Skip to content

Commit 3dacfcf

Browse files
RaymondMouthaandceejay
authored andcommitted
node-red owner fix (#136)
1 parent 9097992 commit 3dacfcf

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

.docker/Dockerfile.alpine

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,15 @@ RUN set -ex && \
3131
# Set work directory
3232
WORKDIR /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
3735
COPY package.json .
3836

3937
#### Stage BUILD #######################################################################################################
4038
FROM base AS build
4139

42-
USER root
4340
# Install Build tools
4441
RUN apk add --no-cache --virtual buildtools build-base linux-headers udev python
4542

46-
USER node-red
4743
RUN npm install --only=production
4844
RUN /tmp/remove_native_gpio.sh
4945
RUN 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
7671
RUN /tmp/install_devtools.sh && \
7772
rm /tmp/* && rm /usr/bin/qemu-$QEMU_ARCH-static
7873

79-
USER node-red
8074
COPY --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
8378
ENV 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
8883
VOLUME ["/data"]
8984

85+
USER node-red
86+
9087
# Expose the listening port of node-red
9188
EXPOSE 1880
9289

0 commit comments

Comments
 (0)