Spaces:
Sleeping
Sleeping
Commit ·
8aefb58
1
Parent(s): 80ea05b
Update entrypoint.sh
Browse files1234564578978101112131112141516171819#!/bin/bash
# Get the username from the command line arguments or use a default valueUSERNAME=${1:-default_user}
# Check if the user already existsif id "$USER_ID" >/dev/null 2>&1; then echo "User with ID $USER_ID already exists."if id "$USERNAME" >/dev/null 2>&1; then echo "User $USERNAME already exists."else # Create the user adduser --uid "$USER_ID" --disabled-password --gecos '' appuser # Create the user with a home directory and a bash shell useradd -m -s /bin/bash "$USERNAME"fi
# Continue with the application startupexec "$@"# Set appropriate permissions for the application directorychown -R "$USERNAME":"$USERNAME" /app
# Start your applicationexec gosu "$USERNAME" uvicorn app.main:app --host 0.0.0.0 --port 7860 --reload
entrypoint.sh+13-6