Spaces:
Sleeping
Sleeping
Commit
·
aa82c4e
1
Parent(s):
ed9b501
Update entrypoint.sh
Browse files- entrypoint.sh +12 -7
entrypoint.sh
CHANGED
@@ -1,15 +1,20 @@
|
|
1 |
#!/bin/bash
|
2 |
set -e
|
3 |
|
4 |
-
#
|
5 |
-
|
6 |
-
|
|
|
|
|
|
|
7 |
adduser --disabled-password --gecos "" --uid "$USER_ID" user
|
8 |
-
|
9 |
-
# Switch to the newly created user
|
10 |
su -l user
|
11 |
fi
|
12 |
|
13 |
-
#
|
14 |
-
|
|
|
|
|
15 |
|
|
|
|
|
|
1 |
#!/bin/bash
|
2 |
set -e
|
3 |
|
4 |
+
# Create user with unique identifier (optional)
|
5 |
+
# This example assumes your user management system sets the UID
|
6 |
+
# You may need to adjust this based on your implementation
|
7 |
+
if [ -z "$USER_ID" ]; then
|
8 |
+
echo "USER_ID environment variable not set. Skipping user creation."
|
9 |
+
else
|
10 |
adduser --disabled-password --gecos "" --uid "$USER_ID" user
|
|
|
|
|
11 |
su -l user
|
12 |
fi
|
13 |
|
14 |
+
# Load user's configuration (optional)
|
15 |
+
if [ -f "user_config.json" ]; then
|
16 |
+
export USER_CONFIG_PATH="/app/user_config.json"
|
17 |
+
fi
|
18 |
|
19 |
+
# Start the Hugging Face space application
|
20 |
+
exec "$@"
|