-
-
Notifications
You must be signed in to change notification settings - Fork 5
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 #157 from sonroyaalmerol/docker-entrypoint
Add PUID/PGID setting on container runtime
- Loading branch information
Showing
4 changed files
with
40 additions
and
7 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,18 @@ | ||
#!/bin/sh | ||
|
||
# Add a group with the specified PGID if it doesn't already exist | ||
if ! getent group appgroup > /dev/null 2>&1; then | ||
addgroup -g "${PGID}" appgroup | ||
fi | ||
|
||
# Add a user with the specified PUID if it doesn't already exist | ||
if ! id -u appuser > /dev/null 2>&1; then | ||
adduser -D -u "${PUID}" -G appgroup appuser | ||
fi | ||
|
||
# Change ownership of the app directory | ||
chown -R appuser:appgroup /m3u-proxy | ||
|
||
# Switch to the new user and execute the main application | ||
exec su-exec appuser "$@" | ||
|
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