File size: 323 Bytes
45e3447
9e90a21
45e3447
9e90a21
45e3447
9e90a21
 
 
 
 
 
45e3447
 
9e90a21
5f4973d
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh
set -e

# Check if the user needs to be created
if [ "$(id -u)" = "0" ]; then
    if id "$USER_ID" >/dev/null 2>&1; then
        echo "User with ID $USER_ID already exists."
    else
        useradd -m -u "$USER_ID" user
        chown -R user:user /app
    fi
fi

# Execute the CMD or provided command
exec "$@"