diff --git a/Dockerfile b/Dockerfile index a179473a..28a7946c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -50,7 +50,7 @@ RUN set -ex; \ zlib1g && \ apt-get clean && \ rm -rf /var/lib/apt/lists/*; \ - useradd -u 911 -U -M -s /bin/false changedetection && \ + useradd -u 911 -U -m -s /bin/false changedetection && \ usermod -G users changedetection; \ mkdir -p /datastore diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 37f4c9cb..3bff5b4d 100644 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -21,6 +21,7 @@ if [ "$(id -u)" = '0' -a -z "${KEEP_PRIVILEGES:-}" ]; then # Look for files in datadir not owned by the correct user and chown them find "$DATASTORE_PATH" \! -user changedetection -exec chown changedetection '{}' + + chown -R changedetection:changedetection ~changedetection # Restart this script as an unprivileged user exec gosu changedetection:changedetection "$BASH_SOURCE" "$@"