Skip to content

Commit

Permalink
fix: root added as user
Browse files Browse the repository at this point in the history
  • Loading branch information
Abbhiishek committed Apr 5, 2024
1 parent 158fc7f commit fc75362
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions apps/web/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,19 @@ FROM base AS runner
WORKDIR /app

# Don't run production as root
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
USER nextjs

RUN chmod -R o-w . && chown -R nextjs:nodejs .
# RUN addgroup --system --gid 1001 nodejs
# RUN adduser --system --uid 1001 nextjs
# USER nextjs

COPY --from=installer /app/apps/web/next.config.js .
COPY --from=installer /app/apps/web/package.json .

# Automatically leverage output traces to reduce image size
# https://nextjs.org/docs/advanced-features/output-file-tracing
COPY --from=installer --chown=nextjs:nodejs /app/apps/web/.next/standalone ./
COPY --from=installer --chown=nextjs:nodejs /app/apps/web/.next/static ./apps/web/.next/static
COPY --from=installer --chown=nextjs:nodejs /app/apps/web/public ./apps/web/public
COPY --from=installer --chown=root:root --chmod=644 /app/apps/web/.next/standalone ./
COPY --from=installer --chown=root:root --chmod=644 /app/apps/web/.next/static ./apps/web/.next/static
COPY --from=installer --chown=root:root --chmod=644 /app/apps/web/public ./apps/web/public


ENV PORT=3000
EXPOSE 3000
Expand Down

0 comments on commit fc75362

Please sign in to comment.