Init
This commit is contained in:
commit
f90fdc0598
99 changed files with 15260 additions and 0 deletions
34
scripts/entrypoint.sh
Executable file
34
scripts/entrypoint.sh
Executable file
|
@ -0,0 +1,34 @@
|
|||
#!/bin/sh
|
||||
|
||||
cat logo.txt
|
||||
echo ""
|
||||
|
||||
if [ -n "$PUID" ] || [ -n "$PGID" ]; then
|
||||
USER=appuser
|
||||
HOME=/app
|
||||
|
||||
if ! grep -q "$USER" /etc/passwd; then
|
||||
# Usage: addgroup [-g GID] [-S] [USER] GROUP
|
||||
#
|
||||
# Add a group or add a user to a group
|
||||
# -g GID Group id
|
||||
addgroup -g "$PGID" "$USER"
|
||||
|
||||
# Usage: adduser [OPTIONS] USER [GROUP]
|
||||
# Create new user, or add USER to GROUP
|
||||
# -h DIR Home directory
|
||||
# -g GECOS GECOS field
|
||||
# -G GRP Group
|
||||
# -D Don't assign a password
|
||||
# -H Don't create home directory
|
||||
# -u UID User id
|
||||
adduser -h "$HOME" -g "" -G "$USER" -D -H -u "$PUID" "$USER"
|
||||
fi
|
||||
|
||||
chown "$USER":"$USER" "$HOME" -R
|
||||
printf "UID: %s GID: %s\n\n" "$PUID" "$PGID"
|
||||
exec su -c - $USER ./cafe
|
||||
else
|
||||
printf "WARNING: Running docker as root\n\n"
|
||||
exec ./cafe
|
||||
fi
|
Loading…
Add table
Add a link
Reference in a new issue