-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #80 from AlexSciFier/new-entypoint-script
Added new entrypoint script
- Loading branch information
Showing
3 changed files
with
31 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/sh | ||
|
||
echo "Setting umask to ${UMASK}" | ||
umask ${UMASK} | ||
echo "Creating database and backgrounds directories" | ||
mkdir -p ./data ./public/static/media/background | ||
|
||
if [ `id -u` -eq 0 ] && [ `id -g` -eq 0 ]; then | ||
if [ "${UID}" -eq 0 ]; then | ||
echo "Warning: it is not recommended to run as root user, please check your setting of the UID environment variable" | ||
fi | ||
echo "Changing ownership to ${UID}:${GID}" | ||
chown -R "${UID}":"${GID}" ./data ./public/static/media/background | ||
echo "Running Neonlink as user ${UID}:${GID}" | ||
su-exec "${UID}":"${GID}" node server.js | ||
else | ||
echo "User set by docker; running Neonlink as `id -u`:`id -g`" | ||
node server.js | ||
fi |