Update CMD to serve instead of run; remove deps.ts in favor of deno.json#440
Update CMD to serve instead of run; remove deps.ts in favor of deno.json#440kimdcottrell wants to merge 5 commits intodenoland:mainfrom
Conversation
| COPY deps.ts . | ||
| RUN deno install --entrypoint deps.ts | ||
| # Cache the dependencies as a layer (the following two steps are re-run only when deno.json is modified). | ||
| # Ideally cache deno.json will download and compile _all_ external files used in main.ts. |
There was a problem hiding this comment.
This is not preferable. With deno cache on like 62, we are going to install only dependencies that are actually used. Here all deps are installed, even if they are unused. We should wait for denoland/deno#27229
There was a problem hiding this comment.
I agree. The dependency install and the caching of it should be sorted first.
The main reason I made this PR was to overcome an issue around the CMD and how the webserver was running, which would throw an error thanks to the approach it was using.
The deps.ts -> deno.json blurb got caught up in this since that also appears to be a remnant from Deno 1.
I'll try to keep an eye on your PR, and once it's merged, I'll alter this one to reflect your approach.
|
Since the mentioned denoland/deno#27229 issue has been closed as completed, and I just stumbled over some idiosyncrasies with Is there any news on this? The examples with |
This fixes this issue:
#424
You can fix that issue as well by keeping the
CMDas is, but you have to alter themain.tsto be:I went with
deno servesince you can keep all the hostname and port configs in the Dockerfile and reduce repetition.deps.tswas removed in favor ofdemo.jsonas it, orpackage.json, seems to be the path forward in Deno 2.