feat(devcontainer): publish app port to host for CLI workflows#426
Conversation
The devcontainer CLI ignores devcontainer.json's forwardPorts (a VS Code editor feature), so the Go server wasn't reachable from the host when running via `devcontainer exec`. Publish the container port at the Docker layer in the generated workspace compose file, and parameterize the server PORT in the Makefile (default unchanged at 8080) so each checkout can use a distinct port. Add conductor.json setup/run scripts that bring up the devcontainer, install deps, and run the app on a per-workspace port. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis PR enables configurable and stable port allocation in the development environment, allowing parallel workspaces to operate independently. The Docker Compose setup computes deterministic host ports from workspace names or explicit configuration, while Makefile and Conductor scripts integrate those ports into the build and run workflows. ChangesPort Configuration and Wiring
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Adds a host port publish for the devcontainer-managed Go server so the app is reachable from the host when started via devcontainer exec (the CLI ignores forwardPorts). Parameterizes the server PORT in the Makefile and introduces a conductor.json to orchestrate per-workspace devcontainer setup/run with distinct ports.
Changes:
- Makefile: introduces
PORT ?= 8080(exported) and uses it inNEXT_PUBLIC_API_BASE_URL. .devcontainer/write-workspace-compose.sh: publishes a host port (fromADB_HOST_PORTor a hash of the workspace name) to the container, 1:1 when pinned.- New
conductor.json: setup/run scripts that bring up the devcontainer and run the app on$CONDUCTOR_PORT.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| Makefile | Adds parameterized PORT variable and threads it into NEXT_PUBLIC_API_BASE_URL for run_all. |
| .devcontainer/write-workspace-compose.sh | Emits a ports: mapping in the generated workspace compose, using ADB_HOST_PORT (1:1) or a hashed fallback. |
| conductor.json | New Conductor config wiring devcontainer up/exec with ADB_HOST_PORT/PORT set to $CONDUCTOR_PORT. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The
devcontainerCLI ignores devcontainer.json'sforwardPorts(a VS Code editor feature), so the Go server wasn't reachable from the host when running viadevcontainer exec; this publishes the container port at the Docker layer in the generated workspace compose file. The Makefile now parameterizes the serverPORT(default unchanged at 8080) so each checkout can listen on a distinct port, andwrite-workspace-compose.shpublishes host→container 1:1 when a port is pinned so the logged port matches the reachable host port. A newconductor.jsonadds setup/run scripts that bring up the devcontainer, install deps, and run the app on a per-workspace port. Default local/VS Code behavior is unchanged.🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Chores