fix: port drift on restart — down before preflight, read port from .env
Makefile restart target now runs compose down before preflight so ports are free when preflight assigns them; previously preflight ran first while the old container still held 8502, causing it to bump to 8503. manage.sh start/restart/open now read STREAMLIT_PORT from .env instead of re-running preflight after startup (which would see the live container and bump the reported port again).
This commit is contained in:
parent
bf33a584b4
commit
49513cc081
2 changed files with 7 additions and 5 deletions
6
Makefile
6
Makefile
|
|
@ -47,8 +47,10 @@ start: preflight ## Preflight check then start Peregrine (PROFILE=remote|cpu|si
|
||||||
stop: ## Stop all Peregrine services
|
stop: ## Stop all Peregrine services
|
||||||
$(COMPOSE) down
|
$(COMPOSE) down
|
||||||
|
|
||||||
restart: preflight ## Preflight check then restart all services
|
restart: ## Stop services, re-run preflight (ports now free), then start
|
||||||
$(COMPOSE) down && $(COMPOSE) $(COMPOSE_FILES) --profile $(PROFILE) up -d
|
$(COMPOSE) down
|
||||||
|
@$(PYTHON) scripts/preflight.py
|
||||||
|
$(COMPOSE) $(COMPOSE_FILES) --profile $(PROFILE) up -d
|
||||||
|
|
||||||
logs: ## Tail app logs
|
logs: ## Tail app logs
|
||||||
$(COMPOSE) logs -f app
|
$(COMPOSE) logs -f app
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ case "$CMD" in
|
||||||
start)
|
start)
|
||||||
info "Starting Peregrine (PROFILE=${PROFILE})..."
|
info "Starting Peregrine (PROFILE=${PROFILE})..."
|
||||||
make start 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}"
|
success "Peregrine is up → http://localhost:${PORT}"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|
@ -95,7 +95,7 @@ case "$CMD" in
|
||||||
restart)
|
restart)
|
||||||
info "Restarting (PROFILE=${PROFILE})..."
|
info "Restarting (PROFILE=${PROFILE})..."
|
||||||
make restart 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}"
|
success "Peregrine restarted → http://localhost:${PORT}"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|
@ -148,7 +148,7 @@ case "$CMD" in
|
||||||
;;
|
;;
|
||||||
|
|
||||||
open)
|
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}"
|
URL="http://localhost:${PORT}"
|
||||||
info "Opening ${URL}"
|
info "Opening ${URL}"
|
||||||
if command -v xdg-open &>/dev/null; then
|
if command -v xdg-open &>/dev/null; then
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue