Skip to content

Commit

Permalink
build: run the production apps as the node user
Browse files Browse the repository at this point in the history
In the production image, change the owner and group of all the app files to `node:node`, then run the Next.js apps as `node`.
  • Loading branch information
eatyourgreens committed Dec 5, 2024
1 parent 57ccf1f commit ebfab6f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ RUN mkdir -p /usr/src

WORKDIR /usr/src/

RUN chown -R node:node .

USER node

COPY --from=builder /usr/src/package.json /usr/src/package.json

COPY --from=builder /usr/src/.yarn /usr/src/.yarn
Expand Down

0 comments on commit ebfab6f

Please sign in to comment.