Skip to content

Commit b718924

Browse files
authored
Merge pull request #15 from PKuebler/PKuebler-wait-for-it-host
Use Laravel db host env variable to test db connection.
2 parents 8588329 + c9ec438 commit b718924

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

home/app/run-dev.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ composer install --prefer-dist --no-progress --no-interaction
1717
yarn
1818

1919
# migrate and setup database
20-
wait-for-it.sh mysql:3306
20+
if [ -z "$DB_HOST" ]; then
21+
wait-for-it.sh $DB_HOST
22+
fi
2123
php artisan migrate --force
2224
php artisan setup
2325

home/app/run-prod.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ chown www-data:www-data -R /opt/app/storage
1010
chown www-data:www-data -R /opt/app/bootstrap/cache
1111

1212
# migrate and setup database
13-
wait-for-it.sh mysql:3306
13+
if [ -z "$DB_HOST" ]; then
14+
wait-for-it.sh $DB_HOST
15+
fi
1416
php artisan migrate --force
1517
php artisan setup
1618

0 commit comments

Comments
 (0)