diff --git a/Dockerfile b/Dockerfile index e8c8822..c61b7a0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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