circulartext commited on
Commit
ad11504
1 Parent(s): 022c763

Update entrypoint.sh

Browse files
Files changed (1) hide show
  1. entrypoint.sh +6 -14
entrypoint.sh CHANGED
@@ -1,24 +1,16 @@
1
- #!/bin/sh
 
 
2
  set -e
3
 
4
- # Define the user ID in the environment variable USER_ID with a default value
5
- ARG USER_ID=1000
6
- ENV USER_ID=$USER_ID
7
-
8
  # Check if the user already exists
9
  if id "$USER_ID" >/dev/null 2>&1; then
10
  echo "User with ID $USER_ID already exists."
11
  else
12
- echo "Creating user with ID $USER_ID."
13
  useradd -m -u "$USER_ID" user
14
  fi
15
 
16
- # Set appropriate permissions for the application directory
17
- chown -R user:user /app
18
- chmod -R 755 /app
19
-
20
- # Print environment variables for debugging
21
- echo "USER_ID: $USER_ID"
22
-
23
- # Execute the main command
24
  exec "$@"
 
 
1
+ bash
2
+ Copy code
3
+ #!/bin/bash
4
  set -e
5
 
 
 
 
 
6
  # Check if the user already exists
7
  if id "$USER_ID" >/dev/null 2>&1; then
8
  echo "User with ID $USER_ID already exists."
9
  else
10
+ # Create a new user with the specified ID
11
  useradd -m -u "$USER_ID" user
12
  fi
13
 
14
+ # Run the CMD or any other command you want to execute
 
 
 
 
 
 
 
15
  exec "$@"
16
+