diff --git a/Dockerfile b/Dockerfile index eb71dd3..f28f0b6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,9 +17,8 @@ RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories ttf-freefont \ ttf-liberation \ ttf-inconsolata \ - # 更多中文字体支持 + # 字体配置工具 fontconfig \ - freetype2-dev \ tini \ # OCR相关包 tesseract-ocr \ @@ -27,17 +26,29 @@ RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories tesseract-ocr-data-eng \ && rm -rf /var/cache/apk/* -# 配置字体支持(可选:从资源目录复制自定义字体) +# 备用字体安装(如果需要更多中文字体支持) +RUN echo "Installing additional Chinese fonts..." && \ + apk add --no-cache \ + # 备用中文字体包 + font-adobe-100dpi \ + font-adobe-75dpi \ + font-alias \ + font-util \ + || echo "Some font packages not available, continuing with default fonts" + +# 配置字体支持(从资源目录复制自定义字体) RUN if [ -f "/build/src/main/resources/SIMYOU.TTF" ]; then \ mkdir -p /usr/share/fonts && \ cp /build/src/main/resources/SIMYOU.TTF /usr/share/fonts/ && \ + echo "Copied SIMYOU.TTF to fonts directory" && \ fc-cache -fv; \ else \ echo "SIMYOU.TTF not found in resources, using system fonts"; \ fi # 生成字体缓存以确保系统字体正确识别 -RUN fc-cache -fv || echo "Font cache generation completed" +RUN fc-cache -fv || echo "Font cache generation completed with warnings" + # ===== Maven 构建阶段 ===== # 使用更小的Alpine Maven镜像进行构建