Skip to content

Commit

Permalink
run image as user 'node'
Browse files Browse the repository at this point in the history
  • Loading branch information
gcavelier authored Nov 20, 2023
1 parent 7635d48 commit c48fc2b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
FROM node:18.18.2-bookworm-slim

USER node
WORKDIR /usr/src/app

ARG NPM_REGISTRY='https://registry.npmjs.org'

COPY package*.json ./
COPY --chown=node:node package*.json ./
RUN npm ci --omit dev --registry $NPM_REGISTRY && npm cache clean --force
COPY . .
COPY --chown=node:node . .

EXPOSE 3000
CMD [ "node", "app.js" ]

0 comments on commit c48fc2b

Please sign in to comment.