diff --git a/Dockerfile b/Dockerfile index 2dd8349f..fd66d89b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -42,7 +42,9 @@ CMD ["pnpm", "dev:local"] # Stage 3: Builder (Production) FROM base AS builder RUN --mount=type=cache,target=/app/.next/cache,id=nextjs-cache \ - pnpm build + pnpm build && \ + mkdir -p /app/.next-cache-tmp && \ + cp -r /app/.next/cache/* /app/.next-cache-tmp/ || true # Stage 3: Runner FROM registry.infra.mintel.me/mintel/runtime:v1.7.10 AS runner @@ -61,6 +63,6 @@ ENV NODE_ENV=production COPY --from=builder --chown=nextjs:nodejs /app/public ./public 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/.next/cache ./.next/cache +COPY --from=builder --chown=nextjs:nodejs /app/.next-cache-tmp ./.next/cache CMD ["node", "server.js"]