Choose Free Port#724
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds host-port auto-discovery to the generated Aegis Stack project so make serve / make serve-bg can automatically select an available host port (and optionally shift backing-service host ports), allowing multiple stacks to run side-by-side without manual config edits.
Changes:
- Introduces
scripts/find-free-port.shandscripts/resolve-ports.shto detect free host ports and emitexport ...lines for Compose. - Updates Makefile and Compose templates to use auto-selected host ports (plus README note), and adds tests exercising the scripts directly.
- Updates the lockfile (Typer 0.25.1 → 0.26.4).
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
uv.lock |
Bumps Typer version in the lockfile. |
tests/test_serve_port_autodiscovery.py |
Adds tests for the new port-discovery helper scripts. |
aegis/templates/copier-aegis-project/{{ project_slug }}/scripts/resolve-ports.sh |
Emits Compose export lines and a banner for chosen ports. |
aegis/templates/copier-aegis-project/{{ project_slug }}/scripts/find-free-port.sh |
Scans for an available TCP port starting at a base port. |
aegis/templates/copier-aegis-project/{{ project_slug }}/README.md.jinja |
Documents automatic port selection behavior for make serve. |
aegis/templates/copier-aegis-project/{{ project_slug }}/Makefile.jinja |
Wires make serve / serve-bg to evaluate exported ports before Compose up. |
aegis/templates/copier-aegis-project/{{ project_slug }}/docker-compose.yml.jinja |
Uses WEBSERVER_HOST_PORT (when set) for host port publishing. |
aegis/templates/copier-aegis-project/{{ project_slug }}/docker-compose.dev.yml.jinja |
Applies host-port overrides for webserver, (optional) Redis/Postgres/Ollama, and (optional) Traefik. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.