Spaces:
Sleeping
Sleeping
Commit ·
8aefb58
1
Parent(s): 80ea05b
Update entrypoint.sh
Browse files123456789101112#!/bin/bash# Check if the user already existsif id "$USER_ID" >/dev/null 2>&1; thenecho "User with ID $USER_ID already exists."else# Create the useradduser --uid "$USER_ID" --disabled-password --gecos '' appuserfi# Continue with the application startupexec "$@"12345678910111213141516171819#!/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 "$USERNAME" >/dev/null 2>&1; thenecho "User $USERNAME already exists."else# Create the user with a home directory and a bash shelluseradd -m -s /bin/bash "$USERNAME"fi# 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