I am trying to create simple ephemeral HTTP services using Deno and Node.js within a Dagger TypeScript module (@object/@func). The goal is to define these services, run them using dagger call <function> --up, and access the exposed port from my host machine (localhost).
I am using the pattern:
.container().from(...).withNewFile(...).withWorkdir(...).withExec(...).withExposedPort(INTERNAL_PORT).asService()
While a similar service defined using Python and .asService({ args: [...] }) works correctly and is accessible from the host, the Deno and Node.js services defined with .withExec().asService() are not.
The dagger call ... --up command runs, the Dagger TUI often shows the internal server logs indicating it's listening (e.g., "[Node Server] Successfully listening on internal port 3000"), and Dagger reports a forwarded port (e.g., INFO listening: service ... port XXXX forwarding to http://127.0.0.1:yyyyy). However, attempting to access http://127.0.0.1:yyyyy from the host machine fails (e.g., curl reports "Connection refused" or times out).