build(web): single compiled Dockerfile for the Fresh frontend#5
Merged
Conversation
The vite server manifest was read from the cwd-relative path _fresh/server/.vite/manifest.json, which only resolves under `deno serve` (cwd=web/). A `deno compile` binary extracts embedded files to a temp dir, so the read failed and the shared admin/form-component stylesheet was never linked. Resolve it relative to import.meta.dirname so it works under both.
Replace the `deno serve` web image with Fresh's deno-compile recipe: deno task build, then deno compile _fresh/compiled-entry.js into one glibc binary that embeds the runtime, bundle, and static assets. Drop node_modules before compiling (the SSR bundle is self-contained) so the binary stays ~83MB; bake in --unstable-kv and --include static, and create the KV dir. Consolidates the former Dockerfile.web.compile into the single Dockerfile.web that cd.yaml builds.
poly-glot
added a commit
that referenced
this pull request
Jun 7, 2026
build(web): single compiled Dockerfile for the Fresh frontend
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Consolidates the web image to one
Dockerfile.webbuilt with Fresh'sdeno compilerecipe (replaces thedeno serveapproach; the oldDockerfile.web.compileis removed).Changes
Dockerfile.web:deno task build→deno compile_fresh/compiled-entry.js into one self-contained glibc binary. Dropsnode_modulesbefore compiling (SSR bundle is self-contained) → binary ~83 MB, image 274 MB. Bakes in--unstable-kv+--include static, creates the KV dir.lib/server-entry-css.ts: read the vite manifest relative toimport.meta.dirnameinstead of cwd, so the shared admin/form CSS links under bothdeno serveand a compiled binary (which extracts embedded files to a temp dir).Compatibility
deployment/base/web.yaml: nocommandoverride, port 8000,/healthzprobes,KV_PATH/DMOZDB_HOSTvia env. No manifest change.cd.yamlalready buildsDockerfile.web— no CI change.Verification (local, full stack)
/→ 200,/healthz→ 200,/favicon.ico→ 200 (embedded static), 0 runtime errors.deno compileemits glibc-only binaries (no musl target).Caveat: local test used a local KV file; prod uses remote denokv (same runtime/flags/code as the prior
deno serveimage, so expected identical).