This commit is contained in:
2025-11-01 17:19:40 +08:00
parent aa7f4fb686
commit bd0fc6a284
4 changed files with 179 additions and 4 deletions

View File

@@ -108,12 +108,17 @@ RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
# 更新包索引(使用国内镜像)
RUN apk update --no-cache
# 一次性安装所有基础包(减少层数和下载次数
# 一次性安装所有基础包(包含字体支持
RUN apk add --no-cache \
ca-certificates \
curl \
bash \
tini \
fontconfig \
ttf-dejavu \
ttf-liberation \
ttf-droid \
ttf-freefont \
&& rm -rf /var/cache/apk/*
# Tesseract OCR 安装(完全独立,失败不影响主应用)
@@ -135,8 +140,10 @@ RUN rm -rf /var/cache/apk/* /tmp/* /var/tmp/*
RUN curl --version && echo "✓ Core components verified"
# 设置环境变量
ENV JAVA_OPTS="-Xmx2g -Xms1g -XX:+UseG1GC -XX:MaxGCPauseMillis=200"
ENV JAVA_OPTS="-Xmx2g -Xms1g -XX:+UseG1GC -XX:MaxGCPauseMillis=200 -Djava.awt.headless=true"
ENV SPRING_PROFILES_ACTIVE=prod
ENV FONTCONFIG_PATH=/etc/fonts
ENV FC_DEBUG=1
# 创建应用用户和目录
RUN addgroup -g 1001 app \