preorder/entrypoint.sh

16 lines
347 B
Bash
Raw Normal View History

2024-06-18 04:37:32 +00:00
#!/bin/bash
set -e
# Wait for the database to be ready
while ! mysqladmin ping -h"db" --silent; do
echo "Waiting for database connection..."
sleep 2
done
# Run the SQL script to initialize the database
mysql -h db -uroot -p$MYSQL_ROOT_PASSWORD < /docker-entrypoint-initdb.d/create_database.sql
# Execute the original command
exec "$@"