diff --git a/docker-compose.yaml b/docker-compose.yaml index c8be331..cbf6a79 100755 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -12,3 +12,4 @@ services: environment: - PUID=1000 # Replace with your desired user ID | Remove both if you want to run as root (not recommended, might result in unreadable files) - PGID=1000 # Replace with your desired group ID | The user must have write permissions in the volume mapped to /app/downloads + - UMASK=0022 # Optional: Sets the default file permissions for newly created files within the container. diff --git a/entrypoint.sh b/entrypoint.sh index a68c531..0a34996 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,6 +1,11 @@ #!/bin/bash set -e +# Set umask if UMASK variable is provided +if [ -n "${UMASK}" ]; then + umask "${UMASK}" +fi + # Check if both PUID and PGID are not set if [ -z "${PUID}" ] && [ -z "${PGID}" ]; then # Run as root directly @@ -42,4 +47,4 @@ else # Run as specified user exec gosu "${USER_NAME}" "$@" fi -fi \ No newline at end of file +fi