Merge pull request #56 from larswnd/patch-1
Add UMASK Environment Variable Support and Documentation to docker-compose.yml
This commit is contained in:
@@ -12,3 +12,4 @@ services:
|
|||||||
environment:
|
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)
|
- 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
|
- 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.
|
||||||
|
|||||||
@@ -1,6 +1,11 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
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
|
# Check if both PUID and PGID are not set
|
||||||
if [ -z "${PUID}" ] && [ -z "${PGID}" ]; then
|
if [ -z "${PUID}" ] && [ -z "${PGID}" ]; then
|
||||||
# Run as root directly
|
# Run as root directly
|
||||||
@@ -42,4 +47,4 @@ else
|
|||||||
# Run as specified user
|
# Run as specified user
|
||||||
exec gosu "${USER_NAME}" "$@"
|
exec gosu "${USER_NAME}" "$@"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user