fix: Update Dockerfile to correctly copy Next.js 15 standalone output structure
Some checks failed
CI/CD Pipeline (Dev/Staging) / staging (push) Failing after 8m11s
Some checks failed
CI/CD Pipeline (Dev/Staging) / staging (push) Failing after 8m11s
This commit is contained in:
@@ -59,14 +59,15 @@ ls -la .next/standalone/
|
|||||||
|
|
||||||
#### Problem: Falsche Verzeichnisstruktur
|
#### Problem: Falsche Verzeichnisstruktur
|
||||||
|
|
||||||
Next.js 15 könnte eine andere Struktur haben. Prüfe:
|
**✅ GELÖST**: Die Debug-Ausgabe zeigt, dass Next.js 15 die Struktur `.next/standalone/` direkt verwendet:
|
||||||
```bash
|
- `.next/standalone/server.js` ✅
|
||||||
# Nach dem Build
|
- `.next/standalone/.next/` ✅
|
||||||
find .next/standalone -name "server.js"
|
- `.next/standalone/node_modules/` ✅
|
||||||
```
|
- `.next/standalone/package.json` ✅
|
||||||
|
|
||||||
Falls `server.js` in `.next/standalone/app/server.js` ist, ist das Dockerfile korrekt.
|
**NICHT**: `.next/standalone/app/server.js` ❌
|
||||||
Falls es in `.next/standalone/server.js` ist, muss das Dockerfile angepasst werden.
|
|
||||||
|
Das Dockerfile wurde korrigiert, um `.next/standalone/` direkt zu kopieren.
|
||||||
|
|
||||||
## Debugging
|
## Debugging
|
||||||
|
|
||||||
|
|||||||
@@ -70,8 +70,9 @@ RUN chown nextjs:nodejs .next
|
|||||||
# Automatically leverage output traces to reduce image size
|
# Automatically leverage output traces to reduce image size
|
||||||
# https://nextjs.org/docs/advanced-features/output-file-tracing
|
# https://nextjs.org/docs/advanced-features/output-file-tracing
|
||||||
# Copy standalone output (contains server.js and all dependencies)
|
# Copy standalone output (contains server.js and all dependencies)
|
||||||
# The standalone output structure is: .next/standalone/app/
|
# The standalone output structure is: .next/standalone/ (not .next/standalone/app/)
|
||||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone/app ./
|
# Next.js creates: .next/standalone/server.js, .next/standalone/.next/, .next/standalone/node_modules/
|
||||||
|
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/static ./.next/static
|
||||||
|
|
||||||
# Copy Prisma files
|
# Copy Prisma files
|
||||||
|
|||||||
Reference in New Issue
Block a user