diff --git a/Dockerfile b/Dockerfile index 7f8477e..3a05d5b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,7 @@ EXPOSE 3000 FROM base as builder WORKDIR /app COPY . . -RUN yarn install +RUN yarn install --immutable RUN yarn build FROM base as production @@ -15,11 +15,8 @@ WORKDIR /app ENV NODE_ENV=production COPY --from=builder --chown=nextjs:nodejs /app/.next ./.next COPY --from=builder /app/node_modules ./node_modules -COPY --from=builder /app/.yarn ./.yarn -COPY --from=builder /app/yarnrc.yml ./yarnrc.yml COPY --from=builder /app/package.json ./package.json COPY --from=builder /app/public ./public -RUN yarn install --immutable RUN addgroup -g 1001 -S nodejs RUN adduser -S nextjs -u 1001 USER nextjs @@ -28,5 +25,5 @@ CMD yarn start FROM base as dev ENV NODE_ENV=development COPY . . -RUN yarn install +RUN yarn install --immutable CMD yarn dev