Browse Source

fix: 修复生成pdf报错

大侠咬超人 2 days ago
parent
commit
044fccc3ee
2 changed files with 18 additions and 1 deletions
  1. 4 1
      Dockerfile
  2. 14 0
      docs/ops-commands.md

+ 4 - 1
Dockerfile

@@ -49,6 +49,8 @@ RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
         nss \
         freetype \
         harfbuzz \
+        # dbus(解决 Chrome 在容器中的连接问题)
+        dbus \
         # 字体(PDF 中文显示必须)
         ttf-freefont \
         font-noto-cjk \
@@ -58,7 +60,8 @@ RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
         # PDF 合并工具
         poppler-utils \
         && rm -rf /var/cache/apk/* \
-        && fc-cache -fv
+        && fc-cache -fv \
+        && mkdir -p /run/dbus
 
 # 设置 Chrome 环境变量
 ENV CHROME_BIN=/usr/bin/chromium-browser \

+ 14 - 0
docs/ops-commands.md

@@ -178,3 +178,17 @@ docker update --cpus=1 --memory=1g math_cms_pdf
 ## 联系方式
 
 如有问题请联系开发团队。
+
+### 常用日志查看
+
+```
+docker exec math_cms_app grep -A 10 "exam-answer-analysis\|ERROR" storage/logs/laravel.log | tail -50
+
+tail -200 storage/logs/laravel.log
+
+  # 实时监控(自动刷新)
+  docker exec math_cms_app tail -f storage/logs/laravel.log
+
+  # 组合:先显示最近 200 行,然后实时监控
+  docker exec math_cms_app tail -200f storage/logs/laravel.log
+```