perf: add Docker build cache for Next.js
All checks were successful
Gitea CI / test-build (push) Successful in 11m6s
All checks were successful
Gitea CI / test-build (push) Successful in 11m6s
Mount .next/cache as a BuildKit cache volume during build to persist the Next.js build cache across Docker rebuilds. Eliminates the 'No build cache found' warning and speeds up subsequent builds. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -31,10 +31,10 @@ RUN npx prisma generate
|
||||
# Copy source code (this invalidates cache when code changes)
|
||||
COPY . .
|
||||
|
||||
# Build the application
|
||||
# Build the application (mount cache for faster rebuilds)
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
ENV NODE_ENV=production
|
||||
RUN npm run build
|
||||
RUN --mount=type=cache,target=/app/.next/cache npm run build
|
||||
|
||||
# Verify standalone output was created and show structure for debugging
|
||||
RUN if [ ! -d .next/standalone ]; then \
|
||||
|
||||
Reference in New Issue
Block a user