diff --git a/app/main/api/Dockerfile b/app/main/api/Dockerfile index 3d2165f..53b7d53 100644 --- a/app/main/api/Dockerfile +++ b/app/main/api/Dockerfile @@ -24,7 +24,7 @@ FROM alpine:3.19 RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories \ && apk update --no-cache \ # 基础运行环境 - && apk add --no-cache ca-certificates tzdata \ + && apk add --no-cache ca-certificates tzdata fontconfig \ # chromedp 所需的 Chromium 浏览器及依赖 && apk add --no-cache \ chromium \ @@ -46,6 +46,10 @@ COPY --from=builder /app/main /app/main COPY --from=builder /app/etc /app/etc COPY --from=builder /app/static /app/static +# 将自定义字体资源拷贝到系统字体目录,供 Chromium 渲染中文使用(如果存在) +COPY resource /usr/share/fonts/custom +RUN fc-cache -f || true + # 报告 PDF 缓存目录(与配置中的 ./data/report-pdf 对应) RUN mkdir -p /app/data/report-pdf VOLUME ["/app/data/report-pdf"] diff --git a/resource/simhei.ttf b/resource/simhei.ttf new file mode 100644 index 0000000..3326815 Binary files /dev/null and b/resource/simhei.ttf differ