Update CMD to serve instead of run; remove deps.ts in favor of deno.json
This fixes this issue:
https://github.com/denoland/deno_docker/issues/424
You can fix that issue as well by keeping the CMD as is, but you have to alter the main.ts to be:
Deno.serve(
{ port: 1993, hostname: "0.0.0.0" },
(_req) => new Response("Hello, world")
);
I went with deno serve since you can keep all the hostname and port configs in the Dockerfile and reduce repetition.
deps.ts was removed in favor of demo.json as it, or package.json , seems to be the path forward in Deno 2.
Since the mentioned https://github.com/denoland/deno/issues/27229 issue has been closed as completed, and I just stumbled over some idiosyncrasies with deno install vs deno cache, also in the end with deno serve while using Docker/Podman:
Is there any news on this?
The examples with deps.ts without further explanation how to use this seems very counterintuitive in the age of deno.json.