File size: 546 Bytes
80db73d
45e3447
0ca1319
 
26f1ecd
dfd32bf
fbafdd6
 
dfd32bf
fbafdd6
 
87aacc5
5783142
fbafdd6
0ca1319
fbafdd6
d0fa205
 
46a96ce
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash

# Get the username from the environment variable, or use a default value
USERNAME=${1:-default_user}

# Check if the user already exists
if id "$USERNAME" >/dev/null 2>&1; then
    echo "User $USERNAME already exists."
else
    # Create the user with a home directory and a bash shell
    useradd -m -s /bin/bash "$USERNAME"
fi

# Set appropriate permissions for the application directory
chown -R "$USERNAME":"$USERNAME" /app

# Start your application
exec gosu "$USERNAME" uvicorn app.main:app --host 0.0.0.0 --port 7860 --reload