Auto-detect API container in search Makefile, add lockfile

The Makefile targets (migrate, ingest, shell) hardcoded api-dev, which
fails when running in production mode. Now auto-detects whichever API
container is active (dev or prod) via docker compose ps.
This commit is contained in:
Ryan Malloy 2026-03-01 19:59:47 -07:00
parent 8faaf9ab13
commit b943a3a0ae
2 changed files with 2357 additions and 3 deletions

View File

@ -2,6 +2,9 @@
.DEFAULT_GOAL := dev .DEFAULT_GOAL := dev
# Auto-detect which API container is running (dev or prod)
API_SVC := $(shell docker compose ps --format '{{.Service}}' 2>/dev/null | grep -m1 'api-' || echo 'api-prod')
# Development mode with hot reload # Development mode with hot reload
dev: dev:
@echo "Starting pg_orrery Search in development mode..." @echo "Starting pg_orrery Search in development mode..."
@ -37,15 +40,15 @@ restart: down dev
# Run database migrations # Run database migrations
migrate: migrate:
docker compose exec api-dev alembic upgrade head docker compose exec $(API_SVC) alembic upgrade head
# Run content ingestion # Run content ingestion
ingest: ingest:
docker compose exec api-dev python -m orrery_search.ingest docker compose exec $(API_SVC) python -m orrery_search.ingest
# Shell into running API container # Shell into running API container
shell: shell:
docker compose exec api-dev bash docker compose exec $(API_SVC) bash
# Check vectorizer status # Check vectorizer status
status: status:

2351
search/uv.lock generated Normal file

File diff suppressed because it is too large Load Diff