From de32be4144b49bec690da736c6c45b948189c91b Mon Sep 17 00:00:00 2001 From: sn0w Date: Thu, 10 Jan 2019 19:49:47 +0100 Subject: [PATCH] Make custom.d work again --- Dockerfile | 2 +- entrypoint.sh | 23 +++++++++++++---------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2f0634c..5e2ba04 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,7 +14,7 @@ EXPOSE 4000 # Get dependencies RUN \ apk add --no-cache --virtual .tools \ - git curl postgresql-client \ + git curl rsync postgresql-client \ \ && apk add --no-cache --virtual .sdk \ build-base \ diff --git a/entrypoint.sh b/entrypoint.sh index 6f078d2..789dcaf 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -2,29 +2,32 @@ # shellcheck shell=dash set -e -set -x if [ -n "$BUILDTIME" ]; then + echo "#> Preparing compilation..." + mix local.rebar --force mix local.hex --force + echo "#> Compiling..." mix deps.get mix compile 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 +echo "#> Applying customizations and patches.." +rsync -av /custom.d/ /home/pleroma/pleroma/ -# Recompile +echo "#> Recompiling..." mix compile -# Migrate db +echo "#> Waiting until database is ready..." +while ! pg_isready -U pleroma -d postgres://db:5432/pleroma -t 1; do + sleep 1s +done + +echo "#> Upgrading database..." mix ecto.migrate -# Off we go! +echo "#> Liftoff!" exec mix phx.server