- Update dockerfile to use existing PUID, PGID if exists and create one as fallback.

- include environment variables in docker compose as well
This commit is contained in:
gitmotion
2025-05-04 18:58:52 -07:00
parent 65d10a6576
commit 6cf39e4639
2 changed files with 9 additions and 6 deletions

View File

@@ -23,10 +23,12 @@ RUN . /opt/venv/bin/activate && \
# Add virtual environment to PATH
ENV PATH="/opt/venv/bin:$PATH"
# Create group and user
# We use the ARG values here. The entrypoint script will handle runtime adjustments if ENV vars are set.
RUN addgroup -g ${PGID} nodeuser && \
adduser -u ${PUID} -G nodeuser -s /bin/sh -D nodeuser
# Create group and user with fallback to prevent build failures
# We use the ARG values here, but with a fallback mechanism to avoid build failures
RUN addgroup -g ${PGID} nodeuser 2>/dev/null || \
(echo "Group with GID ${PGID} already exists, creating with alternate GID" && addgroup nodeuser) && \
adduser -u ${PUID} -G nodeuser -s /bin/sh -D nodeuser 2>/dev/null || \
(echo "User with UID ${PUID} already exists, creating with alternate UID" && adduser -G nodeuser -s /bin/sh -D nodeuser)
WORKDIR /usr/src/app

View File

@@ -1,5 +1,3 @@
version: '3.8'
services:
dumbdrop:
image: dumbwareio/dumbdrop:latest
@@ -25,6 +23,9 @@ services:
# APPRISE_MESSAGE: "New file uploaded - {filename} ({size}), Storage used {storage}" # Notification message template with placeholders: {filename}, {size}, {storage}
# APPRISE_SIZE_UNIT: "Auto" # Size unit for notifications (B, KB, MB, GB, TB, or Auto)
# ALLOWED_EXTENSIONS: ".jpg,.jpeg,.png,.pdf,.doc,.docx,.txt" # Comma-separated list of allowed file extensions (default: all allowed)
# PUID: 1000 # User ID for file ownership (default: 1000)
# PGID: 1000 # Group ID for file ownership (default: 1000)
# UMASK: "000" # File permissions mask (default: 000)
restart: unless-stopped
# user: "${PUID}:${PGID}" # Don't set user here, entrypoint handles it
# Consider adding healthcheck