Use `node` user rather than root within Dockerfile

This commit is contained in:
Stefan Forstenlechner 2022-04-17 15:26:52 +02:00
parent 2923e1b373
commit 76632cea0b
1 changed files with 5 additions and 0 deletions

View File

@ -17,7 +17,12 @@ RUN npm ci --only=production
COPY picture-gallery-server .
RUN npm run build-server
RUN chown node:node -R /usr/src/app/picture-gallery-server/dist && \
chown node:node -R /usr/src/app/picture-gallery-client/build
VOLUME /usr/src/app/public
EXPOSE 3001
USER node
# we are still in the server directory
CMD npm --prefix ../picture-gallery-client/ run set-environment && node dist/app.js