Update Dockerfile

This commit is contained in:
Liam 2022-10-29 13:53:30 +01:00
parent c6ad53c228
commit 5d9dfe860c

View File

@ -16,9 +16,6 @@ RUN \
# Copy cached files
COPY node_modules ./
# Install dependencies
RUN yarn
# Rebuild the source code only when needed
FROM node:18-alpine AS builder
WORKDIR /app
@ -56,6 +53,9 @@ COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
COPY --from=builder --chown=nextjs:nodejs /app/public ./.next/static
# Install dependencies
RUN yarn
RUN chown -R nextjs:nodejs /app
USER nextjs