docker: Add support for UID:GID

Adds support for the UID/GID env variables in Docker via `gosu`.
This commit is contained in:
Dedy Martadinata S
2022-07-12 15:37:08 +07:00
committed by GitHub
parent 9a869a1474
commit 46546dac27
3 changed files with 13 additions and 5 deletions

View File

@@ -35,4 +35,13 @@ if [[ ! -r "$CONFIG_FILE" ]]; then
exit 1;
fi
exec /app/lldap "$@"
echo "> Setup permissions.."
find /app \! -user "$UID" -exec chown "$UID:$GID" '{}' +
find /data \! -user "$UID" -exec chown "$UID:$GID" '{}' +
echo "> Starting lldap.."
echo ""
exec gosu "$UID:$GID" /app/lldap "$@"
exec "$@"