feat: добавить каркас приложения с PostgreSQL, сессиями и Redis-кэшем
This commit is contained in:
committed by
Evgeny Bushkov (aider)
parent
0ab3a341aa
commit
d8ba046033
@@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
# Перезапускает API и все используемые хранилища, сохраняя volumes.
|
||||
# Не выполняет down -v, не flush-ит Redis, не пересоздаёт данные.
|
||||
docker compose restart api postgres redis
|
||||
# Ждём готовности API (тест сам ждёт /health/ready, но полезно и здесь).
|
||||
i=0
|
||||
while [ "$i" -lt 60 ]; do
|
||||
if docker compose exec -T api python -c "import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://127.0.0.1:8080/health/ready',timeout=2).status==200 else 1)" >/dev/null 2>&1; then
|
||||
exit 0
|
||||
fi
|
||||
i=$((i+1))
|
||||
sleep 1
|
||||
done
|
||||
echo "api did not become ready" >&2
|
||||
exit 1
|
||||
Reference in New Issue
Block a user