forked from mtusi2026/mtusi2026lab5
Реализована лабораторная работа 5 на оценку 4
This commit is contained in:
Executable
+17
@@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
docker compose --env-file .env start api1 api2 >/dev/null
|
||||
for service in api1 api2; do
|
||||
container_id=$(docker compose --env-file .env ps -q "$service")
|
||||
attempts=0
|
||||
until [ "$(docker inspect --format '{{.State.Health.Status}}' "$container_id" 2>/dev/null || true)" = healthy ]; do
|
||||
attempts=$((attempts + 1))
|
||||
if [ "$attempts" -ge 60 ]; then
|
||||
printf '%s\n' "$service did not become healthy" >&2
|
||||
exit 1
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
done
|
||||
Reference in New Issue
Block a user