docker_entrypoint.sh 647 Bytes
Newer Older
1
#!/bin/sh
2 3 4 5 6 7

### 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})..."
8
addgroup -g ${GID} mastodon && adduser -h /mastodon -s /bin/sh -D -G mastodon -u ${UID} mastodon
9 10

echo "Updating permissions..."
11
find /mastodon -path /mastodon/public/system -prune -o -not -user mastodon -not -group mastodon -print0 | xargs -0 chown -f mastodon:mastodon
12 13 14

echo "Executing process..."
exec su-exec mastodon:mastodon /sbin/tini -- "[email protected]"