From 302e05fe1fc421703411471b9cd0b619a8a64347 Mon Sep 17 00:00:00 2001 From: xfy Date: Thu, 16 Jul 2026 18:16:35 +0800 Subject: [PATCH] =?UTF-8?q?fix(docker):=20=E8=A1=A5=E9=BD=90=20Dockerfile?= =?UTF-8?q?=20=E7=BC=BA=E5=A4=B1=E7=9A=84=20katex-css=20=E4=B8=8E=20restor?= =?UTF-8?q?e-webp=20=E6=AD=A5=E9=AA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 对齐 make build-linux 流水线,修两个同步遗漏: - katex-css:镜像缺此步导致 $...$/$$...$$ 渲染成裸 span,无 KaTeX 字体排版。 - restore-webp:dx 0.7.9 会把 public/*.webp 重编码成 VP8L 静图(动画帧 丢失、体积反增 7-8×),需用源文件覆盖回 dx 产物目录后再拷贝。 两处均在注释中标注 keep in sync with make build-linux。 --- Dockerfile | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4825286..e71c576 100644 --- a/Dockerfile +++ b/Dockerfile @@ -144,15 +144,20 @@ RUN cd libs && pnpm install --frozen-lockfile # Copy the rest of the source tree and build everything. COPY . . -# Build all 4 JS libs, syntax-highlight CSS and Tailwind stylesheet. -# These steps produce the contents of the public/ directory. -RUN make build-libs && make highlight-css && tailwindcss -i input.css -o public/style.css --minify +# Build all 4 JS libs, syntax-highlight CSS, KaTeX CSS + fonts and Tailwind +# stylesheet. These steps produce the contents of the public/ directory. +# Must stay in sync with make build-linux — katex-css was previously missing, +# which left math rendering as bare spans without KaTeX fonts. +RUN make build-libs && make highlight-css && make katex-css && tailwindcss -i input.css -o public/style.css --minify # Build the client-side Dioxus WASM bundle. We use dx only for the client assets; # dx's linker wrapper is incompatible with a raw static linker, so the server # binary is built with plain cargo in the next step. The client build emits a # ready-to-serve public/ directory under target/dx/yggdrasil/*/web/public. +# restore-webp overwrites dx's re-encoded VP8L .webp stills with the source +# originals — keep in sync with make build-linux, which runs the same target. RUN dx build @client --release --debug-symbols=false --wasm-js-cfg false && \ + make restore-webp && \ mkdir -p /build/dist/public && \ cp -r /build/target/dx/yggdrasil/*/web/public/* /build/dist/public/