From abf254133e710bfb14722da885ffc4a612b119c5 Mon Sep 17 00:00:00 2001 From: Cameron Porter Date: Sun, 9 Jul 2023 18:16:18 -0500 Subject: [PATCH] Use the 'node' user instead of root when running. --- Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dockerfile b/Dockerfile index 92b3f7e62..00baae145 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