From 8e0ccf59e0de018a4eae8c1b8d79274bcb1be1d3 Mon Sep 17 00:00:00 2001 From: Vylyne <94922829+Vylyne@users.noreply.github.com> Date: Wed, 1 Oct 2025 12:35:14 -0400 Subject: [PATCH] added PUID and GUID Args For buildtime UID and GID specification, Add User and Group with those ids and set User at entrypiont call. there will be permission errors. --- Dockerfile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 816bdd3c3..8239e4761 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,7 +25,7 @@ RUN apk add --no-cache --update \ unzip WORKDIR /server -COPY index.js package* /server +COPY index.js package* /server/ COPY /server /server/server RUN case "$TARGETPLATFORM" in \ @@ -45,12 +45,18 @@ FROM node:20-alpine ARG NUSQLITE3_DIR ARG NUSQLITE3_PATH +ARG PUID=1000 +ARG PGID=1000 # Install only runtime dependencies RUN apk add --no-cache --update \ tzdata \ ffmpeg \ - tini + tini \ + shadow \ + && addgroup -g ${PGID} audiobookshelf \ + && adduser -u ${PUID} -G audiobookshelf -D audiobookshelf \ + && apk del --purge shadow WORKDIR /app @@ -69,5 +75,6 @@ ENV SOURCE="docker" ENV NUSQLITE3_DIR=${NUSQLITE3_DIR} ENV NUSQLITE3_PATH=${NUSQLITE3_PATH} +USER audiobookshelf ENTRYPOINT ["tini", "--"] CMD ["node", "index.js"]