Skip to content

Commit

Permalink
Use variable for datastore in Docker entrypoint
Browse files Browse the repository at this point in the history
  • Loading branch information
lkubb committed Jul 5, 2022
1 parent 39f315a commit 5534b50
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

set -eu

DATASTORE_DIR="/datastore"

# If the first argument looks like a flag, assume we want to run changedetection
if [ "${1:0:1}" = '-' ]; then
set -- python ./changedetection.py -d /datastore "$@"
set -- python ./changedetection.py -d "$DATASTORE_DIR" "$@"
fi

# If we're running as root, by default make sure process uid/gid
Expand All @@ -18,7 +20,7 @@ if [ "$(id -u)" = '0' -a -n "${KEEP_PRIVILEGES:-}" ]; then
usermod -o -u "$PUID" changedetection

# Look for files in datadir not owned by the correct user and chown them
find "/datastore" \! -user changedetection -exec chown changedetection '{}' +
find "$DATASTORE_DIR" \! -user changedetection -exec chown changedetection '{}' +

# Restart this script as an unprivileged user
exec gosu changedetection:changedetection "$BASH_SOURCE" "$@"
Expand Down

0 comments on commit 5534b50

Please sign in to comment.