Fixhancement: improve UID support (#5963)

This commit is contained in:
shamoon
2025-11-11 08:56:44 -08:00
committed by GitHub
parent 0dafc792f7
commit 8a75c9b6e3
2 changed files with 4 additions and 2 deletions

View File

@@ -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 RUN apk add --no-cache su-exec iputils-ping shadow
USER root
ENV NODE_ENV=production ENV NODE_ENV=production
ENV HOSTNAME=0.0.0.0 ENV HOSTNAME=0.0.0.0
ENV PORT=3000 ENV PORT=3000

View File

@@ -57,8 +57,8 @@ if [ -d /app/.next ]; then
fi fi
# Drop privileges (when asked to) if root, otherwise run as current user # Drop privileges (when asked to) if root, otherwise run as current user
if [ "$(id -u)" == "0" ] && [ "${PUID}" != "0" ]; then if [ "$(id -u)" = "0" ] && [ "${PUID}" != "0" ]; then
su-exec ${PUID}:${PGID} "$@" exec su-exec ${PUID}:${PGID} "$@"
else else
exec "$@" exec "$@"
fi fi