move precompilation to image runtime instead of image build

This commit is contained in:
Jeffrey Paul 2019-12-09 02:02:22 -08:00
parent 72a9dc7d78
commit 6eb1523991
2 changed files with 39 additions and 4 deletions

View File

@ -23,7 +23,3 @@ bundle install \
-j$(getconf _NPROCESSORS_ONLN) \ -j$(getconf _NPROCESSORS_ONLN) \
--deployment --without development test --deployment --without development test
yarn install --pure-lockfile --ignore-engines yarn install --pure-lockfile --ignore-engines
OTP_SECRET=precompile_placeholder \
SECRET_KEY_BASE=precompile_placeholder \
bundle exec rails assets:precompile

View File

@ -7,7 +7,46 @@ done
echo "web starting..." 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 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
"
exec \ exec \
envdir /state/envdir \ envdir /state/envdir \
chpst -u mastodon:mastodon \ chpst -u mastodon:mastodon \