circulartext commited on
Commit
aa82c4e
·
1 Parent(s): ed9b501

Update entrypoint.sh

Browse files
Files changed (1) hide show
  1. entrypoint.sh +12 -7
entrypoint.sh CHANGED
@@ -1,15 +1,20 @@
1
  #!/bin/bash
2
  set -e
3
 
4
- # Check if USER_ID environment variable is set
5
- if [ -n "$USER_ID" ]; then
6
- # Create user with specific UID and disabled password
 
 
 
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
- # Execute the command provided to the container as arguments
14
- exec "$@"
 
 
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 "$@"