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

28
scripts/wait_for_containers.sh Executable file
View File

@@ -0,0 +1,28 @@
#!/bin/bash
SERVICES=("web" "mysql")
function check_containers {
for service in "${SERVICES[@]}"; do
if ! docker compose ps $service | grep "Up" > /dev/null; then
return 1
fi
done
return 0
}
echo "Waiting for docker containers..."
MAX_WAIT_TIME=60
WAIT_TIME=0
while ! check_containers; do
if [ $WAIT_TIME -ge $MAX_WAIT_TIME ]; then
echo "Containers have not started within $MAX_WAIT_TIME seconds. Exit."
exit 1
fi
sleep 1
WAIT_TIME=$((WAIT_TIME + 1))
done
echo "All docker containers executed."