From 34dd0cd4574b89cfff31f396748cf2cb39725487 Mon Sep 17 00:00:00 2001 From: Martin Date: Mon, 20 Jul 2026 13:57:08 +0200 Subject: [PATCH] =?UTF-8?q?Fix:=20HOSTNAME=3D0.0.0.0=20f=C3=BCr=20Next-Sta?= =?UTF-8?q?ndalone-Server=20(Erreichbarkeit/Healthcheck)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- Dockerfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Dockerfile b/Dockerfile index 50bd09f..28aae98 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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