-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
32 lines (22 loc) · 827 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
FROM alpine:3.20.1 AS base
RUN apk add --no-cache \
nodejs \
ca-certificates \
npm && \
mkdir -p /usr/src/node-red /data && \
adduser -h /usr/src/node-red -D -H node-red -u 1000 && \
chmod 0777 /usr/src/node-red /data && \
chown -R node-red:node-red /data
FROM nodered/node-red:4.0.2-minimal AS build
COPY package.json .
RUN npm install \
--unsafe-perm --no-update-notifier \
--no-audit --only=production
FROM base AS prod
COPY --from=build --chown=node-red:node-red /data/ /data/
WORKDIR /usr/src/node-red
COPY settings.js /data/settings.js
COPY flows.json /data/flows.json
COPY --from=build --chown=node-red:node-red /usr/src/node-red/ /usr/src/node-red/
USER node-red
CMD ["npm", "start", "--cache", "/data/.npm", "--", "--userDir", "/data"]