From 1d73a572973592c6d1e47fc734202b969a7bdcb1 Mon Sep 17 00:00:00 2001 From: cmp Date: Mon, 10 Jul 2023 09:50:25 -0500 Subject: [PATCH] Use the 'node' user instead of root when running. (#1894) --- Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dockerfile b/Dockerfile index 92b3f7e6..00baae14 100644 --- a/Dockerfile +++ b/Dockerfile @@ -42,6 +42,9 @@ FROM node:alpine as runner COPY --from=builder /usr/src/app/dist /app/dist COPY --from=builder /usr/src/app/node_modules /app/node_modules +RUN chown -R node:node /app + +USER node EXPOSE 1234 WORKDIR /app CMD node dist/js/server.js