Compare commits

..

No commits in common. "15e7a102cdb0ff249b18e953a5e6d1dd91a99354" and "b137b085d4d838310a15248704f71d064c71809e" have entirely different histories.

2 changed files with 7 additions and 11 deletions

View File

@ -1,15 +1,9 @@
#!/bin/sh
if [ "$(id -u)" -eq 0 ]; then
[ -n "${PUID}" ] && usermod -u "${PUID}" nobody
[ -n "${PGID}" ] && groupmod -g "${PGID}" nobody
fi
[ -n "${PUID}" ] && usermod -u "${PUID}" zs
[ -n "${PGID}" ] && groupmod -g "${PGID}" zs
printf "Configuring zs...\n"
if [ "$(id -u)" -eq 0 ]; then
printf "Switching UID=%s and GID=%s\n" "$(id -u nobody)" "$(id -g nobody)"
exec su-exec nobody:nobody "$@"
else
exec "$@"
fi
printf "Switching UID=%s and GID=%s\n" "${PUID}" "${PGID}"
exec su-exec zs:zs "$@"

View File

@ -50,7 +50,9 @@ RUN apk --no-cache -U add su-exec shadow tzdata ca-certificates curl jq
ENV PUID=1000
ENV PGID=1000
RUN mkdir -p /data && chown -R nobody:nobody /data
RUN addgroup -g "${PGID}" zs && \
adduser -D -H -G zs -h /var/empty -u "${PUID}" zs && \
mkdir -p /data && chown -R zs:zs /data
EXPOSE 8000/tcp