forked from mtusi2026/mtusi2026lab2
lab2 - оценка 4
This commit is contained in:
Executable
+18
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
# Перезапускаем все сервисы, сохраняя volumes
|
||||
docker compose restart api postgres redis
|
||||
|
||||
# Ждем, пока API снова станет готовым (healthcheck)
|
||||
echo "Waiting for API to be ready..."
|
||||
for i in {1..15}; do
|
||||
if curl -sf http://localhost:8080/health/ready > /dev/null; then
|
||||
echo "API is ready."
|
||||
exit 0
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
|
||||
echo "API failed to become ready after restart."
|
||||
exit 1
|
||||
Reference in New Issue
Block a user