pleroma-docker/entrypoint.sh

37 lines
659 B
Bash
Raw Normal View History

#!/bin/ash
# shellcheck shell=dash
2018-08-20 21:06:34 +00:00
set -e
if [ -n "$BUILDTIME" ]; then
2019-08-25 20:39:22 +00:00
echo "#> Getting rebar..."
mix local.rebar --force
2019-08-25 20:39:22 +00:00
echo "#> Getting hex..."
mix local.hex --force
2018-12-24 22:20:17 +00:00
2019-08-25 20:39:22 +00:00
echo "#> Getting dependencies..."
2018-12-24 22:20:17 +00:00
mix deps.get
2019-08-25 20:39:22 +00:00
echo "#> Precompiling..."
2018-12-24 22:20:17 +00:00
mix compile
exit 0
2018-12-24 22:20:17 +00:00
fi
2019-01-10 18:49:47 +00:00
echo "#> Applying customizations and patches.."
rsync -av /custom.d/ /home/pleroma/pleroma/
echo "#> Recompiling..."
mix compile
echo "#> Waiting until database is ready..."
2019-01-10 18:32:40 +00:00
while ! pg_isready -U pleroma -d postgres://db:5432/pleroma -t 1; do
sleep 1s
done
2019-01-10 18:49:47 +00:00
echo "#> Upgrading database..."
2018-08-20 21:06:34 +00:00
mix ecto.migrate
2018-12-24 22:20:17 +00:00
2019-01-10 18:49:47 +00:00
echo "#> Liftoff!"
2018-08-20 21:06:34 +00:00
exec mix phx.server