mirror of
https://github.com/gethomepage/homepage.git
synced 2025-12-05 21:47:48 +01:00
Fixhancement: improve UID support (#5963)
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user