This commit is contained in:
2026-03-11 15:21:53 +08:00
parent 03cb6fd92b
commit 454e60dd72
7 changed files with 240 additions and 133 deletions

View File

@@ -37,12 +37,26 @@ FROM alpine:3.19
# 设置Alpine镜像源
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
# 安装必要的包
RUN apk --no-cache add tzdata curl
# 安装必要的包(包含 headless Chrome 所需依赖)
# - tzdata: 时区
# - curl: 健康检查
# - chromium: 无头浏览器,用于 chromedp 生成 HTML 报告 PDF
# - nss、freetype、harfbuzz、ttf-freefont: 字体及渲染依赖,避免中文/图标丢失
RUN apk --no-cache add \
tzdata \
curl \
chromium \
nss \
freetype \
harfbuzz \
ttf-freefont
# 设置时区
ENV TZ=Asia/Shanghai
# 为 chromedp 指定默认的 Chrome 路径Alpine 下 chromium 包的可执行文件)
ENV CHROME_BIN=/usr/bin/chromium-browser
# 设置工作目录
WORKDIR /app