Spaces:
Sleeping
Sleeping
Commit
·
fb030aa
1
Parent(s):
f5a2123
Update entrypoint.sh
Browse files- entrypoint.sh +5 -18
entrypoint.sh
CHANGED
|
@@ -1,21 +1,8 @@
|
|
| 1 |
-
#!/bin/
|
|
|
|
| 2 |
|
| 3 |
-
#
|
| 4 |
-
USERNAME=${1:-default_user}
|
| 5 |
-
|
| 6 |
-
# Check if the user already exists
|
| 7 |
-
if id "$USERNAME" >/dev/null 2>&1; then
|
| 8 |
-
echo "User $USERNAME already exists."
|
| 9 |
-
else
|
| 10 |
-
# Create the user with a home directory and a bash shell
|
| 11 |
-
useradd -m -s /bin/bash "$USERNAME"
|
| 12 |
-
fi
|
| 13 |
-
# Set appropriate permissions for the application directory
|
| 14 |
chmod -R 777 /app
|
| 15 |
-
# Set appropriate permissions for the application directory
|
| 16 |
-
chown -R "$USERNAME":"$USERNAME" /app
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
# Start your application
|
| 20 |
-
exec gosu "$USERNAME" uvicorn app.main:app --host 0.0.0.0 --port 7860 --reload
|
| 21 |
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/sh
|
| 2 |
+
set -e
|
| 3 |
|
| 4 |
+
# Set permissions at runtime
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
chmod -R 777 /app
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
+
# Execute the main command
|
| 8 |
+
exec "$@"
|