diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index b12e92b..2180bee 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -11,7 +11,7 @@ services: environment: TZ: 'Europe/Prague' PUID: 1000 - GUID: 1000 + GUID: 65534 privileged: true # needed for containers volumes: - ./data:/data diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index a3e6d97..34b421a 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -9,16 +9,16 @@ if [ -z "$PUID" ]; then fi if [ -z "$GUID" ]; then - echo 'Environment variable $PUID not specified' + echo 'Environment variable $GUID not specified' exit 1 fi # create astrid user and group -if [ ! $(getent group astrid) ]; then +if [ ! $(getent group astrid) ] && [ ! $(getent group $GUID) ]; then groupadd --gid $GUID astrid echo "Group astrid with GID $GUID created." fi -if [ ! $(getent passwd astrid) ]; then +if [ ! $(getent passwd astrid) ] && [ ! $(getent passwd $PUID) ]; then useradd --uid $PUID --gid $GUID --create-home --add-subids-for-system astrid echo "User astrid with UID $PUID created." fi