Integrate extensions creation in entry point
Requires postgresql-client to be added to the image Closes #503 Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
0a0ce4a833
commit
030f548f16
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue