Merge two commands in example dockerfile

This commit is contained in:
Zsolt Szabo 2022-09-16 17:16:51 +02:00 committed by GitHub
parent 999efab646
commit 0c3d9de40c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -225,8 +225,7 @@ RUN npm run build
# Make sure the alpine version is the same as in the build stage
FROM alpine:3.16
RUN apk add --no-cache libstdc++
RUN apk add --no-cache dumb-init
RUN apk add --no-cache libstdc++ dumb-init
RUN addgroup -g 1000 node && adduser -u 1000 -G node -s /bin/sh -D node
COPY --from=builder /usr/local/bin/node /usr/local/bin/
@ -239,7 +238,7 @@ COPY --from=builder /build-stage/dist ./dist
RUN chown -R node:node ./
USER node
# Run with dumb-init to not start node with PID=1, since Node.js was not designed to run as PID 1
# Run with dumb-init to not start node with PID=1, since Node.js was not designed to run as PID 1
CMD ["dumb-init", "node", "dist/index.js"]
```