From 8a75c9b6e3a6e2246acffa86c445458cc8a36095 Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Tue, 11 Nov 2025 08:56:44 -0800 Subject: [PATCH] Fixhancement: improve UID support (#5963) --- Dockerfile | 2 ++ docker-entrypoint.sh | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index d58737923..2e5ff0339 100644 --- a/Dockerfile +++ b/Dockerfile @@ -51,6 +51,8 @@ COPY --link --from=builder --chown=1000:1000 /app/.next/static/ ./.next/static RUN apk add --no-cache su-exec iputils-ping shadow +USER root + ENV NODE_ENV=production ENV HOSTNAME=0.0.0.0 ENV PORT=3000 diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 16ce33aa6..5e8f7aa56 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -57,8 +57,8 @@ if [ -d /app/.next ]; then fi # Drop privileges (when asked to) if root, otherwise run as current user -if [ "$(id -u)" == "0" ] && [ "${PUID}" != "0" ]; then - su-exec ${PUID}:${PGID} "$@" +if [ "$(id -u)" = "0" ] && [ "${PUID}" != "0" ]; then + exec su-exec ${PUID}:${PGID} "$@" else exec "$@" fi