feat: Docker-based dev server support for framework-agnostic port mapping#549
feat: Docker-based dev server support for framework-agnostic port mapping#549
Conversation
Complexity AssessmentClassification: COMPLEX Metrics:
Reasoning: Docker infrastructure integration requires architectural decisions (provider pattern, volume mount strategy), multi-step orchestration (build/run/monitor/cleanup), and OS-specific handling. The implementation involves Docker lifecycle management with container-specific error handling and platform-specific volume mount behavior, making this a multi-phase implementation task with significant coordination across configuration, execution, and testing layers. |
Analysis Phase
Executive SummaryIssue #548 requests Docker-based dev server support as an opt-in alternative to the current process-based approach. This solves the framework port-configuration problem (where Angular and similar frameworks don't respect the
HIGH/CRITICAL Risks
Impact Summary
Complete Technical Reference (click to expand for implementation details)Problem Space ResearchProblem UnderstandingSome frameworks (Angular CLI, etc.) ignore the Architectural ContextThe dev server subsystem has three tiers:
Docker mode needs a parallel path at each tier while keeping the command layer unchanged (encapsulate Docker logic in the manager/utility layer). Edge Cases Identified
Codebase Research FindingsAffected Area: Settings Schema (SettingsManager)Entry Point: The
Both variants must be updated:
Dependencies:
Affected Area: DevServerManager (Core Orchestration)Entry Point: Current flow:
For Docker mode, these methods need to:
Key decision: DevServerManager currently doesn't receive settings/config. The constructor takes only
Affected Area: ProcessManager (Detection/Termination)Entry Point:
This means Two approaches:
Affected Area: ResourceCleanup (Container Cleanup)Entry Point:
Affected Area: LoomLauncher (Terminal Launch)Entry Point:
Current behavior: LoomLauncher doesn't load settings for the dev server terminal -- it just runs Affected Area: Dev Server UtilityEntry Point:
Similar Patterns Found
Architectural Flow AnalysisData Flow:
|
Implementation Plan for Issue #548SummaryAdd opt-in Docker-based dev server support so frameworks that ignore the Questions and Key Decisions
High-Level Execution Phases
Quick Stats
Potential Risks (HIGH/CRITICAL only)
Complete Implementation Guide (click to expand for step-by-step details)Automated Test Cases to CreateTest File:
|
Implementation CompleteSummaryAdded opt-in Docker-based dev server support for framework-agnostic port mapping. Frameworks that don't respect the Changes Made
Validation Results
|
Plan Amendments (Gemini Review)The following improvements were incorporated after external AI review: Changes to Implementation
Decisions NOT to change (pragmatic for v1)
|
Code Review Fixes - Issue #548 ✅SummaryFixed three code review issues: aligned Docker container identifier derivation between startup and cleanup paths, added foreground container tracking, and eliminated Docker config extraction duplication across three command files. Changes Made
Validation Results
📋 Detailed Changes by File (click to expand)Files Modifiedsrc/lib/DockerManager.tsChanges: Added
src/lib/DevServerManager.tsChanges: Removed local
src/lib/ResourceCleanup.tsChanges: Fixed identifier derivation for Docker cleanup to match startup path
src/commands/dev-server.tsChanges: Replaced inline Docker config extraction with src/commands/open.tsChanges: Replaced inline Docker config extraction with src/commands/run.tsChanges: Replaced inline Docker config extraction with Test Coverage
|
…gnostic port mapping Add opt-in Docker mode for dev servers where the app runs on its default port inside a container and Docker maps it to the workspace-specific port on the host. This solves the problem of frameworks like Angular CLI that don't respect the PORT environment variable. New DockerManager utility class handles Docker CLI operations (build, run, stop, inspect, port detection). DevServerManager gains Docker execution paths alongside existing process-based paths. ResourceCleanup handles Docker container cleanup. Configuration via capabilities.web.devServer setting in .iloom/settings.json. Closes #548
3229ccb to
366492a
Compare
PR for issue #548
This PR was created automatically by iloom.