mirror of
https://github.com/hoellen/dockerfiles.git
synced 2025-07-01 22:55:39 +00:00
add mastodon image
This commit is contained in:
2
mastodon/rootfs/etc/s6.d/.s6-svscan/finish
Normal file
2
mastodon/rootfs/etc/s6.d/.s6-svscan/finish
Normal file
@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
exit 0
|
3
mastodon/rootfs/etc/s6.d/sidekiq/run
Normal file
3
mastodon/rootfs/etc/s6.d/sidekiq/run
Normal file
@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
cd /mastodon
|
||||
exec bundle exec sidekiq -c $SIDEKIQ_WORKERS -q default -q push -q pull -q mailers
|
3
mastodon/rootfs/etc/s6.d/streaming/run
Normal file
3
mastodon/rootfs/etc/s6.d/streaming/run
Normal file
@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
cd /mastodon
|
||||
exec npm run start
|
3
mastodon/rootfs/etc/s6.d/web/run
Normal file
3
mastodon/rootfs/etc/s6.d/web/run
Normal file
@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
cd /mastodon
|
||||
exec bundle exec rails s -p 3000 -b '0.0.0.0'
|
48
mastodon/rootfs/usr/local/bin/run
Normal file
48
mastodon/rootfs/usr/local/bin/run
Normal file
@ -0,0 +1,48 @@
|
||||
#!/bin/sh
|
||||
|
||||
### 1. Adds local user (UID and GID are provided from environment variables).
|
||||
### 2. Moves precompiled assets into them.
|
||||
### 3. Updates permissions, except for ./public/system (should be chown on previous installations).
|
||||
### NOTE : this can take a long time if overlay2 is the storage-driver (issue #3194).
|
||||
### 4. If $RUN_DB_MIGRATIONS is set to true, runs the database migrations task.
|
||||
### 5. Executes the command as that user.
|
||||
|
||||
echo "
|
||||
---------------------------------------------
|
||||
_____ _ _
|
||||
| |___ ___| |_ ___ _| |___ ___
|
||||
| | | | .'|_ -| _| . | . | . | |
|
||||
|_|_|_|__,|___|_| |___|___|___|_|_|
|
||||
|
||||
A GNU Social-compatible microblogging server
|
||||
https://github.com/tootsuite/mastodon
|
||||
17j2g7vpgHhLuXhN4bueZFCvdxxieyRVWd
|
||||
---------------------------------------------
|
||||
User ID : ${UID}
|
||||
Group ID : ${GID}
|
||||
---------------------------------------------
|
||||
"
|
||||
|
||||
echo "Creating mastodon user..."
|
||||
addgroup -g ${GID} mastodon &>/dev/null
|
||||
adduser -h /mastodon -s /bin/sh -D -G mastodon -u ${UID} mastodon &>/dev/null
|
||||
|
||||
echo "Moving assets to volumes..."
|
||||
mv /tmp/assets/* public/assets &>/dev/null
|
||||
mv /tmp/packs/* public/packs &>/dev/null
|
||||
|
||||
echo "Updating permissions, this can take a while..."
|
||||
find /mastodon -path /mastodon/public/system -prune -o -not -user mastodon -not -group mastodon -print0 | xargs -0 chown -f mastodon:mastodon
|
||||
chown -R mastodon:mastodon /etc/s6.d
|
||||
|
||||
if [ "$RUN_DB_MIGRATIONS" == "true" ]; then
|
||||
echo "Running database migrations task..."
|
||||
su-exec mastodon:mastodon rake db:migrate
|
||||
fi
|
||||
|
||||
echo "Executing process..."
|
||||
if [ '$@' == '' ]; then
|
||||
exec su-exec mastodon:mastodon /bin/s6-svscan /etc/s6.d
|
||||
else
|
||||
exec su-exec mastodon:mastodon "$@"
|
||||
fi
|
Reference in New Issue
Block a user