File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 1
1
FROM node:20-alpine AS builder
2
2
LABEL maintainer="Simone Locci <simonelocci88@gmail.com>"
3
3
4
+ RUN addgroup -S appgroup && adduser -S appuser -G appgroup
5
+
4
6
WORKDIR /app
5
7
COPY . .
6
8
RUN yarn install --immutable \
7
- && yarn build
9
+ && yarn build \
10
+ && chown -R appuser:appgroup /app/docs
8
11
9
12
FROM node:20-alpine
10
13
LABEL maintainer="Simone Locci <simonelocci88@gmail.com>"
@@ -20,7 +23,10 @@ COPY --from=builder /app/package.json ./
20
23
COPY --from=builder /app/.yarn ./.yarn
21
24
COPY --from=builder /app/.yarnrc.yml ./.yarnrc.yml
22
25
COPY --from=builder /app/yarn.lock ./yarn.lock
26
+ COPY --from=builder /etc/passwd /etc/passwd
27
+ COPY --from=builder /etc/group /etc/group
23
28
24
29
EXPOSE 3000
25
30
31
+ USER appuser
26
32
CMD ["node" , "dist/main" ]
You can’t perform that action at this time.
0 commit comments