Files
mtusi2026lab2/scripts/restart.sh
T

13 lines
475 B
Bash
Executable File

#!/bin/sh
# Restart the API and ALL state stores (PostgreSQL, Valkey), keeping volumes.
# Never `down -v`, never flush, never re-seed. Migrations run again (idempotent).
set -eu
cd "$(dirname "$0")/.."
docker compose stop api
docker compose stop valkey postgres
# depends_on brings postgres, valkey and migrate up first; --wait = api healthcheck (/health/ready).
docker compose up -d --no-build --wait api
docker compose ps --all --format 'table {{.Service}}\t{{.Status}}'