Spaces:
Paused
Paused
Update entrypoint.sh
Browse files- entrypoint.sh +7 -6
entrypoint.sh
CHANGED
|
@@ -3,12 +3,13 @@
|
|
| 3 |
# This script acts as a user switcher based on IS_ROOT environment variable.
|
| 4 |
# It executes start.sh with the correct user.
|
| 5 |
|
| 6 |
-
if [ "$IS_ROOT" = "
|
| 7 |
-
echo "ℹ️ IS_ROOT is false. Executing start.sh as 'user'."
|
| 8 |
-
# Use exec to replace the current process with the new one, running as 'user'
|
| 9 |
-
exec sudo -u user -E PATH=/home/user/.local/bin:$PATH /app/start.sh "$@"
|
| 10 |
-
else
|
| 11 |
echo "ℹ️ IS_ROOT is true. Executing start.sh as 'root'."
|
| 12 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
exec /app/start.sh "$@"
|
| 14 |
fi
|
|
|
|
| 3 |
# This script acts as a user switcher based on IS_ROOT environment variable.
|
| 4 |
# It executes start.sh with the correct user.
|
| 5 |
|
| 6 |
+
if [ "$IS_ROOT" = "true" ]; then
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
echo "ℹ️ IS_ROOT is true. Executing start.sh as 'root'."
|
| 8 |
+
# Switch to root using sudo and then execute start.sh
|
| 9 |
+
exec sudo -E PATH=/home/user/.local/bin:$PATH /app/start.sh "$@"
|
| 10 |
+
else
|
| 11 |
+
echo "ℹ️ IS_ROOT is false. Executing start.sh as 'user'."
|
| 12 |
+
# We are already running as 'user' due to Dockerfile's USER instruction,
|
| 13 |
+
# so just execute start.sh directly.
|
| 14 |
exec /app/start.sh "$@"
|
| 15 |
fi
|