Fix: HOSTNAME=0.0.0.0 für Next-Standalone-Server (Erreichbarkeit/Healthcheck)

Next.js standalone server.js bindet sonst an den von Docker gesetzten HOSTNAME
(Container-ID) statt 0.0.0.0 -> Healthcheck (127.0.0.1:3000) schlägt fehl, Container
wird unhealthy, Traefik/Coolify-Proxy routet nicht -> 404. ENV HOSTNAME=0.0.0.0 (+PORT=3000)
behebt beides. Entspricht dem offiziellen Next-Standalone-Dockerfile.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-20 13:57:08 +02:00
co-authored by Claude Opus 4.8
parent 8e69935cf4
commit 34dd0cd457
+5
View File
@@ -25,6 +25,11 @@ RUN npx prisma generate && npm run build
FROM node:22-alpine AS runner
WORKDIR /app
ENV NODE_ENV=production
# Next.js standalone server.js bindet sonst an den von Docker gesetzten HOSTNAME
# (= Container-ID) statt an alle Interfaces -> Healthcheck (127.0.0.1) und der
# Coolify-/Traefik-Proxy erreichen den Container nicht (404). 0.0.0.0 behebt beides.
ENV HOSTNAME=0.0.0.0
ENV PORT=3000
RUN addgroup -S app && adduser -S app -G app
COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/.next/static ./.next/static