diff --git a/Makefile b/Makefile index 8fc0936..5767b9e 100644 --- a/Makefile +++ b/Makefile @@ -47,8 +47,10 @@ start: preflight ## Preflight check then start Peregrine (PROFILE=remote|cpu|si stop: ## Stop all Peregrine services $(COMPOSE) down -restart: preflight ## Preflight check then restart all services - $(COMPOSE) down && $(COMPOSE) $(COMPOSE_FILES) --profile $(PROFILE) up -d +restart: ## Stop services, re-run preflight (ports now free), then start + $(COMPOSE) down + @$(PYTHON) scripts/preflight.py + $(COMPOSE) $(COMPOSE_FILES) --profile $(PROFILE) up -d logs: ## Tail app logs $(COMPOSE) logs -f app diff --git a/manage.sh b/manage.sh index 1fc484b..57665a0 100755 --- a/manage.sh +++ b/manage.sh @@ -82,7 +82,7 @@ case "$CMD" in start) info "Starting Peregrine (PROFILE=${PROFILE})..." make start PROFILE="$PROFILE" - PORT="$(python3 scripts/preflight.py --service streamlit 2>/dev/null || echo 8501)" + PORT="$(grep -m1 '^STREAMLIT_PORT=' .env 2>/dev/null | cut -d= -f2 || echo 8501)" success "Peregrine is up → http://localhost:${PORT}" ;; @@ -95,7 +95,7 @@ case "$CMD" in restart) info "Restarting (PROFILE=${PROFILE})..." make restart PROFILE="$PROFILE" - PORT="$(python3 scripts/preflight.py --service streamlit 2>/dev/null || echo 8501)" + PORT="$(grep -m1 '^STREAMLIT_PORT=' .env 2>/dev/null | cut -d= -f2 || echo 8501)" success "Peregrine restarted → http://localhost:${PORT}" ;; @@ -148,7 +148,7 @@ case "$CMD" in ;; open) - PORT="$(python3 scripts/preflight.py --service streamlit 2>/dev/null || echo 8501)" + PORT="$(grep -m1 '^STREAMLIT_PORT=' .env 2>/dev/null | cut -d= -f2 || echo 8501)" URL="http://localhost:${PORT}" info "Opening ${URL}" if command -v xdg-open &>/dev/null; then