first commit

This commit is contained in:
Nikita Kiselev
2025-07-09 20:55:29 +03:00
commit c3664025ba
26 changed files with 2621 additions and 0 deletions

24
scripts/wait_for_mysql.sh Normal file
View File

@@ -0,0 +1,24 @@
#!/bin/bash
MYSQL_SERVICE="mysql"
function check_mysql {
docker compose exec $MYSQL_SERVICE mysqladmin ping --silent
}
echo "Waiting for MySQL..."
MAX_WAIT_TIME=60
WAIT_TIME=0
while ! check_mysql; do
if [ $WAIT_TIME -ge $MAX_WAIT_TIME ]; then
echo "MySQL has not been available for $MAX_WAIT_TIME secods. Exit."
exit 1
fi
sleep 1
WAIT_TIME=$((WAIT_TIME + 1))
done
sleep 5
echo "MySQL ready."