diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 173d283b..cf1ebd49 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -152,7 +152,6 @@ jobs: # Validate plano config # ────────────────────────────────────────────── validate-config: - needs: docker-build runs-on: ubuntu-latest steps: - name: Checkout code @@ -163,14 +162,8 @@ jobs: with: python-version: "3.14" - - name: Download plano image - uses: actions/download-artifact@v7 - with: - name: plano-image - path: /tmp - - - name: Load plano image - run: docker load -i /tmp/plano-image.tar + - name: Install planoai + run: pip install ./cli - name: Validate plano config run: bash config/validate_plano_config.sh diff --git a/cli/planoai/docker_cli.py b/cli/planoai/docker_cli.py index f691cfb4..0e66c781 100644 --- a/cli/planoai/docker_cli.py +++ b/cli/planoai/docker_cli.py @@ -40,11 +40,35 @@ def docker_remove_container(container: str) -> str: return result.returncode +def _prepare_docker_config(plano_config_file: str) -> str: + """Copy config to a temp file, replacing localhost with host.docker.internal. + + Configs use localhost for native-first mode, but Docker containers need + host.docker.internal to reach services on the host. + """ + import tempfile + + with open(plano_config_file, "r") as f: + content = f.read() + + if "localhost" not in content: + return plano_config_file + + content = content.replace("localhost", "host.docker.internal") + tmp = tempfile.NamedTemporaryFile( + mode="w", suffix=".yaml", prefix="plano_config_", delete=False + ) + tmp.write(content) + tmp.close() + return tmp.name + + def docker_start_plano_detached( plano_config_file: str, env: dict, gateway_ports: list[int], ) -> str: + docker_config = _prepare_docker_config(plano_config_file) env_args = [item for key, value in env.items() for item in ["-e", f"{key}={value}"]] port_mappings = [ @@ -58,7 +82,7 @@ def docker_start_plano_detached( port_mappings_args = [item for port in port_mappings for item in ("-p", port)] volume_mappings = [ - f"{plano_config_file}:/app/plano_config.yaml:ro", + f"{docker_config}:/app/plano_config.yaml:ro", ] volume_mappings_args = [ item for volume in volume_mappings for item in ("-v", volume)