forked from mastodon/mastodon
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Some Dockerfile improvements (mastodon#3182)
- improve docker_entrypoint.sh - serve static files with puma by default - sort packages list - use virtual package for build deps - show how to assign UID/GID
- Loading branch information
1 parent
d680855
commit dc612a7
Showing
3 changed files
with
30 additions
and
14 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 |
---|---|---|
@@ -1,4 +1,14 @@ | ||
#!/bin/sh | ||
|
||
### 1. Adds local user (UID and GID are provided from environment variables). | ||
### 2. Updates permissions, except for ./public/system (should be chown on previous installations). | ||
### 3. Executes the command as that user. | ||
|
||
echo "Creating mastodon user (UID : ${UID} and GID : ${GID})..." | ||
addgroup -g ${GID} mastodon && adduser -h /mastodon -s /bin/sh -D -G mastodon -u ${UID} mastodon | ||
|
||
echo "Updating permissions..." | ||
find /mastodon -path /mastodon/public/system -prune -o -not -user mastodon -not -group mastodon -print0 | xargs -0 chown -f mastodon:mastodon | ||
su-exec mastodon:mastodon /sbin/tini -- "$@" | ||
|
||
echo "Executing process..." | ||
exec su-exec mastodon:mastodon /sbin/tini -- "$@" |