File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change 1+ /.github
2+ /.next
3+ /.env
4+ /node_modules
Original file line number Diff line number Diff line change @@ -2,10 +2,17 @@ FROM node:20.18-alpine AS base
22# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
33RUN apk add --no-cache libc6-compat vips
44WORKDIR /opt/app
5+ # Create a non-root user and group
6+ RUN addgroup -g 10001 app \
7+ && adduser -u 10000 -g app -S -h /home/app app \
8+ && chown -R app:app /opt/app
9+ # Switch to the non-root user
10+ USER app:app
511
612FROM base AS install
7- COPY . .
8- RUN npm install
13+ COPY --chown=app:app . .
14+ RUN chown -R app:app /opt/app \
15+ && npm clean-install
916
1017FROM install AS develop
1118EXPOSE 3000
You can’t perform that action at this time.
0 commit comments