forked from mtusi2026/mtusi2026lab3
на оценку 3
This commit is contained in:
+13
-4
@@ -5,11 +5,20 @@ project_root=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
|
||||
cd "$project_root"
|
||||
|
||||
env_file=${ENV_FILE:-.env}
|
||||
compose() {
|
||||
docker compose --env-file "$env_file" "$@"
|
||||
}
|
||||
|
||||
# PostgreSQL хранит все обязательные данные и сессии в named volume.
|
||||
# Redis содержит только восстанавливаемый кеш и намеренно не имеет volume.
|
||||
docker compose --env-file "$env_file" restart postgres redis
|
||||
docker compose --env-file "$env_file" up -d --wait postgres redis
|
||||
compose restart postgres redis
|
||||
compose up -d --wait postgres redis
|
||||
|
||||
# API перезапускается после восстановления обязательной БД и кеша.
|
||||
docker compose --env-file "$env_file" restart api
|
||||
# up восстанавливает желаемое число реплик, включая ранее вручную остановленную.
|
||||
compose up -d --no-deps api
|
||||
compose restart api
|
||||
compose up -d --wait --no-deps api
|
||||
|
||||
# Публичная точка входа перезапускается последней, когда API уже готовы.
|
||||
compose restart load-balancer
|
||||
compose up -d --wait --no-deps load-balancer
|
||||
|
||||
Reference in New Issue
Block a user