mirror of
https://github.com/invoiceninja/dockerfiles.git
synced 2025-12-31 19:47:25 +01:00
rm db test
This commit is contained in:
@@ -23,26 +23,6 @@ else
|
||||
done
|
||||
fi
|
||||
|
||||
# widely inspired from https://github.com/docker-library/wordpress/blob/c674e9ceedf582705e0ad8487c16b42b37a5e9da/fpm/docker-entrypoint.sh#L128
|
||||
TERM=dumb php -- "$DB_HOST" "$DB_USERNAME" "$DB_PASSWORD" "$DB_DATABASE" <<'EOPHP'
|
||||
<?php
|
||||
$stderr = fopen('php://stderr', 'w');
|
||||
list($host, $port) = explode(':', $argv[1], 2);
|
||||
$maxTries = 20;
|
||||
do {
|
||||
try {
|
||||
$connection = new Pdo("mysql:dbname={$argv[4]};host={$host};port={$port}", $argv[2], $argv[3]);
|
||||
fwrite($stderr, 'MySQL ready'. "\n");
|
||||
exit(0);
|
||||
} catch (PDOException $e) {
|
||||
fwrite($stderr, 'MySQL Connection Error: ' . $e->getMessage(). "\n");
|
||||
if (--$maxTries <= 0) {
|
||||
exit(1);
|
||||
}
|
||||
sleep(3);
|
||||
}
|
||||
} while (true);
|
||||
EOPHP
|
||||
|
||||
#php artisan optimize --force
|
||||
#php artisan migrate --force
|
||||
|
||||
Reference in New Issue
Block a user