mirror of
https://github.com/BililiveRecorder/BililiveRecorder.git
synced 2024-12-25 19:56:10 +08:00
0a2a00ca9f
* feat: Optimize the way to get 'gosu' files * Update Dockerfile and docker-entrypoint.sh * change gosu copy source --------- Co-authored-by: genteure <genteure@gmail.com>
21 lines
475 B
Bash
21 lines
475 B
Bash
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
umask "$UMASK"
|
|
|
|
if [ "$(id -u)" != "0" ]; then
|
|
echo "Skipped changing user and group because current user is not root."
|
|
exec dotnet /app/BililiveRecorder.Cli.dll "$@"
|
|
fi
|
|
|
|
PUID=${PUID:-0}
|
|
PGID=${PGID:-0}
|
|
|
|
if [ "${PUID}" != "0" ] && [ "${PGID}" != "0" ]; then
|
|
chown -R "${PUID}":"${PGID}" /rec
|
|
exec /usr/local/bin/gosu "${PUID}":"${PGID}" dotnet /app/BililiveRecorder.Cli.dll "$@"
|
|
else
|
|
exec dotnet /app/BililiveRecorder.Cli.dll "$@"
|
|
fi
|