Skip to content

Commit

Permalink
Add, user and group for security
Browse files Browse the repository at this point in the history
  • Loading branch information
Seheon Yu committed Feb 28, 2024
1 parent 9225462 commit 096a463
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,17 @@ COPY next.config.js tsconfig.json ./
COPY ./public ./public
COPY ./src ./src

RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs

RUN chown -R nextjs:nodejs /app
USER nextjs

RUN yarn install --immutable
RUN yarn run build

EXPOSE 80
EXPOSE 443
EXPOSE 3000

CMD ["yarn", "start"]
CMD ["yarn", "start"]

0 comments on commit 096a463

Please sign in to comment.