1
0

docker_entrypoint.sh 647 B

1234567891011121314
  1. #!/bin/sh
  2. ### 1. Adds local user (UID and GID are provided from environment variables).
  3. ### 2. Updates permissions, except for ./public/system (should be chown on previous installations).
  4. ### 3. Executes the command as that user.
  5. echo "Creating mastodon user (UID : ${UID} and GID : ${GID})..."
  6. addgroup -g ${GID} mastodon && adduser -h /mastodon -s /bin/sh -D -G mastodon -u ${UID} mastodon
  7. echo "Updating permissions..."
  8. find /mastodon -path /mastodon/public/system -prune -o -not -user mastodon -not -group mastodon -print0 | xargs -0 chown -f mastodon:mastodon
  9. echo "Executing process..."
  10. exec su-exec mastodon:mastodon /sbin/tini -- "$@"