Files
operating-room-monitor-server/start_fresh.sh
2026-05-21 15:48:03 +08:00

21 lines
671 B
Bash
Executable File

#!/usr/bin/env bash
# Reset the unified Docker backend volumes and start a fresh stack.
# This removes PostgreSQL and MinIO data managed by docker-compose.yml.
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$ROOT"
COMPOSE_FILE="${COMPOSE_FILE:-docker-compose.yml}"
API_PORT="${API_PORT:-${PORT:-38080}}"
export API_PORT
echo "Stopping Docker backend stack and removing volumes ($COMPOSE_FILE)..."
docker compose -f "$COMPOSE_FILE" down -v --remove-orphans
echo "Starting fresh Docker backend stack..."
docker compose -f "$COMPOSE_FILE" up -d --build
echo "API: http://127.0.0.1:${API_PORT} (LAN: http://<this-host-lan-ip>:${API_PORT})"