db ready
This commit is contained in:
@ -1,6 +1,15 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
# Wait for the database service to be ready
|
||||||
|
DB_HOST=${DB_HOST:-db}
|
||||||
|
DB_PORT=${DB_PORT:-3306}
|
||||||
|
echo "[⏳] Waiting for database at $DB_HOST:$DB_PORT..."
|
||||||
|
until nc -z $DB_HOST $DB_PORT; do
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
echo "[✔] Database is up and reachable"
|
||||||
|
|
||||||
# Initialize migrations folder if needed
|
# Initialize migrations folder if needed
|
||||||
if [ ! -d migrations ]; then
|
if [ ! -d migrations ]; then
|
||||||
echo "[✔] Initializing migrations directory"
|
echo "[✔] Initializing migrations directory"
|
||||||
|
Reference in New Issue
Block a user