Skip to content

Commit

Permalink
attempt to make the app wait for DB
Browse files Browse the repository at this point in the history
  • Loading branch information
cioraneanu committed Sep 27, 2024
1 parent 4fb3a2d commit 9169a15
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion docker/docker-entrypoint.d/start.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
#!/bin/sh

while true; do
if nc -z -w 5 $DB_HOST $DB_PORT; then
echo "Successfully connected to DB"
break
else
echo "Failed to connect to DB. Retrying in 10 seconds..."
sleep 10
fi
done

php /var/www/html/artisan migrate --isolated --force
php /var/www/html/artisan config:clear
php /var/www/html/artisan config:cache
php /var/www/html/artisan cache:clear
supervisord -c /etc/supervisord.conf
supervisord -c /etc/supervisord.conf

0 comments on commit 9169a15

Please sign in to comment.