Wait for Postgres ready before running migrations
This commit is contained in:
@@ -1,7 +1,14 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
echo "[moonbase] running prisma migrate deploy..."
|
echo "Waiting for Postgres to be ready..."
|
||||||
npx prisma migrate deploy
|
until nc -z postgres 5432 2>/dev/null; do
|
||||||
|
echo " Postgres not ready yet, retrying in 2s..."
|
||||||
|
sleep 2
|
||||||
|
done
|
||||||
|
echo "Postgres is ready."
|
||||||
|
|
||||||
|
echo "Running Prisma migrations..."
|
||||||
|
./node_modules/.bin/prisma migrate deploy
|
||||||
|
|
||||||
exec "$@"
|
exec "$@"
|
||||||
|
|||||||
Reference in New Issue
Block a user