mastodon-docker/rootfs/etc/service/web/run

55 lines
1.2 KiB
Plaintext
Raw Permalink Normal View History

#!/bin/bash
2019-12-09 11:55:55 +00:00
sleep 5
while [[ -e /state/.starting ]]; do
2019-12-09 11:55:55 +00:00
sleep 5
done
echo "web starting..."
rm -rf \
/mastodon/app/public/system \
/mastodon/app/public/assets \
/mastodon/app/public/packs \
/mastodon/log
if [[ ! -d /state/mastodon/system ]]; then
mkdir -p /state/mastodon/system
fi
if [[ ! -d /state/mastodon/assets ]]; then
mkdir -p /state/mastodon/assets
fi
if [[ ! -d /state/mastodon/packs ]]; then
mkdir -p /state/mastodon/packs
fi
if [[ ! -d /state/mastodon/log ]]; then
mkdir -p /state/mastodon/log
fi
chown mastodon:mastodon /state/mastodon /state/mastodon/*
ln -s /state/mastodon/system /mastodon/app/public/system
ln -s /state/mastodon/assets /mastodon/app/public/assets
ln -s /state/mastodon/packs /mastodon/app/public/packs
ln -s /state/mastodon/log /mastodon/app/log
cd /mastodon/app
envdir /state/envdir \
chpst -u mastodon:mastodon \
bash -i -c "
OTP_SECRET=precompile_placeholder
SECRET_KEY_BASE=precompile_placeholder
bundle exec rails assets:precompile
"
2019-12-09 09:15:23 +00:00
exec \
envdir /state/envdir \
chpst -u mastodon:mastodon \
2019-12-09 12:00:01 +00:00
bash -i -c "
bundle exec puma -C config/puma.rb
"