Spaces:
Sleeping
Sleeping
circulartext
commited on
Commit
·
8aefb58
1
Parent(s):
80ea05b
Update entrypoint.sh
Browse files- entrypoint.sh +13 -6
entrypoint.sh
CHANGED
@@ -1,12 +1,19 @@
|
|
1 |
#!/bin/bash
|
2 |
|
|
|
|
|
|
|
3 |
# Check if the user already exists
|
4 |
-
if id "$
|
5 |
-
|
6 |
else
|
7 |
-
|
8 |
-
|
9 |
fi
|
10 |
|
11 |
-
#
|
12 |
-
|
|
|
|
|
|
|
|
|
|
1 |
#!/bin/bash
|
2 |
|
3 |
+
# Get the username from the command line arguments 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
|
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 |
|
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
|
19 |
+
|