Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
lllllllillllllillll authored Nov 19, 2023
1 parent 06a1225 commit e1d1df0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@ ARG NODE_VERSION=20.0.0

FROM node:${NODE_VERSION}-alpine

# Use production node environment by default.
ENV NODE_ENV production

WORKDIR /app

# Run the application as a non-root user.

RUN --mount=type=bind,source=package.json,target=package.json \
    --mount=type=bind,source=package-lock.json,target=package-lock.json \
    --mount=type=cache,target=/root/.npm

# Run the application as a root user.
USER root

# Copy the rest of the source files into the image.
Expand All @@ -19,3 +23,4 @@ EXPOSE 8000

# Run the application.
CMD node app.js

0 comments on commit e1d1df0

Please sign in to comment.