Browse Source

Wait for db during launch

pull/5/head
sn0w 4 years ago
parent
commit
a72cfa9b4e
No known key found for this signature in database
GPG Key ID: DDEDFB9D3FA15727
  1. 2
      Dockerfile
  2. 9
      entrypoint.sh

2
Dockerfile

@ -14,7 +14,7 @@ EXPOSE 4000 @@ -14,7 +14,7 @@ EXPOSE 4000
# Get dependencies
RUN \
apk add --no-cache --virtual .tools \
git curl \
git curl postgresql-client \
\
&& apk add --no-cache --virtual .sdk \
build-base \

9
entrypoint.sh

@ -13,10 +13,17 @@ if [ -n "$BUILDTIME" ]; then @@ -13,10 +13,17 @@ if [ -n "$BUILDTIME" ]; then
exit 0
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
# Migrate db
mix ecto.create
mix ecto.migrate
# Off we go!

Loading…
Cancel
Save