about summary refs log tree commit diff
path: root/docker_entrypoint.sh
diff options
context:
space:
mode:
authorWonderfall <wonderfall@targaryen.house>2017-05-20 20:01:05 +0200
committerEugen Rochko <eugen@zeonfederated.com>2017-05-20 20:01:05 +0200
commitae78d012acfd245228815f4e404f0cfa15c97f55 (patch)
tree136df3de7d200b251012ed27b7a17803484d137e /docker_entrypoint.sh
parentef900789bc99d3bb3cad3b664c7dd5b9bcd1a20c (diff)
Some Dockerfile improvements (#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
Diffstat (limited to 'docker_entrypoint.sh')
-rw-r--r--docker_entrypoint.sh12
1 files changed, 11 insertions, 1 deletions
diff --git a/docker_entrypoint.sh b/docker_entrypoint.sh
index e53261340..e92959c8e 100644
--- a/docker_entrypoint.sh
+++ b/docker_entrypoint.sh
@@ -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 -- "$@"