circulartext commited on
Commit
0ca1319
1 Parent(s): 2015e28

Update entrypoint.sh

Browse files
Files changed (1) hide show
  1. entrypoint.sh +3 -3
entrypoint.sh CHANGED
@@ -1,7 +1,7 @@
1
  #!/bin/bash
2
 
3
- # Get the username from the command line arguments
4
- USERNAME=$1
5
 
6
  # Check if the user already exists
7
  if id "$USERNAME" >/dev/null 2>&1; then
@@ -12,7 +12,7 @@ else
12
  fi
13
 
14
  # Set appropriate permissions for the application directory
15
- chmod -R 777 /app
16
 
17
  # Start your application
18
  exec gosu "$USERNAME" uvicorn app.main:app --host 0.0.0.0 --port 7860 --reload
 
1
  #!/bin/bash
2
 
3
+ # Get the username from the environment variable, or use a default value
4
+ USERNAME=${1:-default_user}
5
 
6
  # Check if the user already exists
7
  if id "$USERNAME" >/dev/null 2>&1; then
 
12
  fi
13
 
14
  # Set appropriate permissions for the application directory
15
+ chown -R "$USERNAME":"$USERNAME" /app
16
 
17
  # Start your application
18
  exec gosu "$USERNAME" uvicorn app.main:app --host 0.0.0.0 --port 7860 --reload