Spaces:
Sleeping
Sleeping
Commit
·
0ca1319
1
Parent(s):
2015e28
Update entrypoint.sh
Browse files- entrypoint.sh +3 -3
entrypoint.sh
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
#!/bin/bash
|
| 2 |
|
| 3 |
-
# Get the username from the
|
| 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 |
-
|
| 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
|