Wait for db during launch
This commit is contained in:
parent
2acfbc8842
commit
a72cfa9b4e
@ -14,7 +14,7 @@ EXPOSE 4000
|
|||||||
# Get dependencies
|
# Get dependencies
|
||||||
RUN \
|
RUN \
|
||||||
apk add --no-cache --virtual .tools \
|
apk add --no-cache --virtual .tools \
|
||||||
git curl \
|
git curl postgresql-client \
|
||||||
\
|
\
|
||||||
&& apk add --no-cache --virtual .sdk \
|
&& apk add --no-cache --virtual .sdk \
|
||||||
build-base \
|
build-base \
|
||||||
|
@ -13,10 +13,17 @@ if [ -n "$BUILDTIME" ]; then
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
set +x
|
||||||
|
while ! pg_isready -U pleroma -d postgres://db:5432/pleroma -t 1; do
|
||||||
|
echo "[X] Database is starting up..."
|
||||||
|
sleep 1s
|
||||||
|
done
|
||||||
|
set -x
|
||||||
|
|
||||||
|
# Recompile
|
||||||
mix compile
|
mix compile
|
||||||
|
|
||||||
# Migrate db
|
# Migrate db
|
||||||
mix ecto.create
|
|
||||||
mix ecto.migrate
|
mix ecto.migrate
|
||||||
|
|
||||||
# Off we go!
|
# Off we go!
|
||||||
|
Loading…
Reference in New Issue
Block a user