Skip to content

Commit

Permalink
Merge pull request #17 from gcavelier/optimize_docker_image
Browse files Browse the repository at this point in the history
Optimize docker image size
  • Loading branch information
alegeay authored Nov 20, 2023
2 parents 0dd8ad5 + c48fc2b commit a390a5a
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
FROM node:lts
FROM node:18.18.2-bookworm-slim

USER node
WORKDIR /usr/src/app

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

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

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

0 comments on commit a390a5a

Please sign in to comment.