Skip to content

Commit

Permalink
Fix user permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
mskelton committed Aug 9, 2024
1 parent 2ec1638 commit a247d2a
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,25 @@ RUN adduser --system --uid 1001 nextjs

COPY --from=builder /app/public ./public

# Set the correct permission for prerender cache
# Set the correct permissions for prerender cache
RUN mkdir .next
RUN chown nextjs:nodejs .next

# Create the DB data directory and set the correct permissions
RUN mkdir /app/data
RUN chown nextjs:nodejs /app/data

# Automatically leverage output traces to reduce image size
# https://nextjs.org/docs/advanced-features/output-file-tracing
# https://nextjs.org/docs/app/api-reference/next-config-js/output
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static

# TODO
# USER nextjs
USER nextjs

EXPOSE 3000

ENV PORT 3000
ENV HOSTNAME "0.0.0.0"
ENV DATABASE_URL "file:/app/mskelton.db"
ENV DATABASE_URL "file:/app/data/mskelton.db"

CMD ["node", "server.js"]

0 comments on commit a247d2a

Please sign in to comment.