Use the 'node' user instead of root when running. (#1894)

This commit is contained in:
cmp 2023-07-10 09:50:25 -05:00 committed by GitHub
parent ed0fd264de
commit 462bdb10c9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -42,6 +42,9 @@ FROM node:alpine as runner
COPY --from=builder /usr/src/app/dist /app/dist COPY --from=builder /usr/src/app/dist /app/dist
COPY --from=builder /usr/src/app/node_modules /app/node_modules COPY --from=builder /usr/src/app/node_modules /app/node_modules
RUN chown -R node:node /app
USER node
EXPOSE 1234 EXPOSE 1234
WORKDIR /app WORKDIR /app
CMD node dist/js/server.js CMD node dist/js/server.js