bb85a0c324
Das runner-Stage uebernimmt node_modules aus dem deps-Stage (npm ci --omit=dev),
enthaelt also kein TypeScript. Next.js konnte die next.config.ts deshalb zur
Laufzeit nicht transpilieren und brach beim Start ab ("Failed to transpile
next.config.ts"). Die Config setzt nur turbopack.root, was fuer `next start`
ohnehin irrelevant ist - daher gleichwertig als CommonJS-JS-Datei.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
26 lines
775 B
Docker
26 lines
775 B
Docker
FROM node:22-slim AS deps
|
|
WORKDIR /app
|
|
RUN apt-get update && apt-get upgrade -y && rm -rf /var/lib/apt/lists/*
|
|
COPY package.json package-lock.json ./
|
|
RUN npm ci --omit=dev
|
|
|
|
FROM node:22-slim AS builder
|
|
WORKDIR /app
|
|
RUN apt-get update && apt-get upgrade -y && rm -rf /var/lib/apt/lists/*
|
|
COPY package.json package-lock.json ./
|
|
RUN npm ci
|
|
COPY . .
|
|
RUN npm run build
|
|
|
|
FROM node:22-slim AS runner
|
|
WORKDIR /app
|
|
RUN apt-get update && apt-get upgrade -y && rm -rf /var/lib/apt/lists/*
|
|
ENV NODE_ENV=production
|
|
COPY --from=deps /app/node_modules ./node_modules
|
|
COPY --from=builder /app/.next ./.next
|
|
COPY --from=builder /app/public ./public
|
|
COPY --from=builder /app/package.json ./package.json
|
|
COPY --from=builder /app/next.config.js ./next.config.js
|
|
EXPOSE 3000
|
|
CMD ["npm", "start"]
|