Merge branch 'integrate-extensions-creation-in-entry-point' into 'master'

Integrate extensions creation in entry point

Closes #503

See merge request framasoft/mobilizon!703
This commit is contained in:
Thomas Citharel 2020-11-14 21:05:23 +01:00
commit 205ae31975
2 changed files with 9 additions and 1 deletions

View file

@ -31,7 +31,7 @@ RUN mix phx.digest \
# Finally setup the app
FROM alpine
RUN apk add --no-cache openssl ncurses-libs file
RUN apk add --no-cache openssl ncurses-libs file postgresql-client
USER nobody
EXPOSE 4000

View file

@ -2,6 +2,14 @@
set -e
echo "-- Waiting for database..."
while ! pg_isready -U ${MOBILIZON_DATABASE_USERNAME} -d postgres://${MOBILIZON_DATABASE_HOST}:5432/${MOBILIZON_DATABASE_DBNAME} -t 1; do
sleep 1s
done
PGPASSWORD=$MOBILIZON_DATABASE_PASSWORD psql -U $MOBILIZON_DATABASE_USERNAME -d $MOBILIZON_DATABASE_DBNAME -h $MOBILIZON_DATABASE_HOST -c 'CREATE EXTENSION IF NOT EXISTS pg_trgm;'
PGPASSWORD=$MOBILIZON_DATABASE_PASSWORD psql -U $MOBILIZON_DATABASE_USERNAME -d $MOBILIZON_DATABASE_DBNAME -h $MOBILIZON_DATABASE_HOST -c 'CREATE EXTENSION IF NOT EXISTS unaccent;'
echo "-- Running migrations..."
/bin/mobilizon_ctl migrate