From fdee39da629fa890836e37a021a980c3de300de6 Mon Sep 17 00:00:00 2001 From: dswbx Date: Thu, 20 Nov 2025 20:04:13 +0100 Subject: [PATCH] fix cli url opener and add minimal debug docker config --- app/src/cli/commands/run/platform.ts | 5 ++++- docker/debug/Dockerfile.minimal | 14 ++++++++++++++ docker/debug/run-minimal.sh | 12 ++++++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 docker/debug/Dockerfile.minimal create mode 100755 docker/debug/run-minimal.sh diff --git a/app/src/cli/commands/run/platform.ts b/app/src/cli/commands/run/platform.ts index ed2e1aa..b20822a 100644 --- a/app/src/cli/commands/run/platform.ts +++ b/app/src/cli/commands/run/platform.ts @@ -67,7 +67,10 @@ export async function startServer( $console.info("Server listening on", url); if (options.open) { - await open(url); + const p = await open(url, { wait: false }); + p.on("error", () => { + $console.warn("Couldn't open url in browser"); + }); } } diff --git a/docker/debug/Dockerfile.minimal b/docker/debug/Dockerfile.minimal new file mode 100644 index 0000000..07868fe --- /dev/null +++ b/docker/debug/Dockerfile.minimal @@ -0,0 +1,14 @@ +FROM alpine:latest + +# Install Node.js and npm +RUN apk add --no-cache nodejs npm + +# Set working directory +WORKDIR /app + +# Create package.json with type: module +RUN echo '{"type":"module"}' > package.json + +# Keep container running (can be overridden) +CMD ["sh"] + diff --git a/docker/debug/run-minimal.sh b/docker/debug/run-minimal.sh new file mode 100755 index 0000000..0a5ca28 --- /dev/null +++ b/docker/debug/run-minimal.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# Build the minimal Alpine image with Node.js +docker build -f Dockerfile.minimal -t bknd-minimal . + +# Run the container with the whole app/src directory mapped +docker run -it --rm \ + -v "$(pwd)/../app:/app/app" \ + -w /app \ + -p 1337:1337 \ + bknd-minimal +