修复arm64打包失败问题;安装微软基础字体
This commit is contained in:
@@ -9,12 +9,22 @@ ENV LC_ALL=zh_CN.UTF-8
|
|||||||
|
|
||||||
# 安装 LibreOffice + 字体支持
|
# 安装 LibreOffice + 字体支持
|
||||||
RUN rm -f /etc/apt/sources.list.d/* && \
|
RUN rm -f /etc/apt/sources.list.d/* && \
|
||||||
echo "deb https://mirrors.ustc.edu.cn/ubuntu/ noble main restricted universe multiverse" > /etc/apt/sources.list && \
|
ARCH=$(dpkg --print-architecture) && \
|
||||||
echo "deb https://mirrors.ustc.edu.cn/ubuntu/ noble-security main restricted universe multiverse" >> /etc/apt/sources.list && \
|
if [ "$ARCH" = "arm64" ]; then \
|
||||||
|
echo "deb https://mirrors.ustc.edu.cn/ubuntu-ports noble main restricted universe multiverse" > /etc/apt/sources.list && \
|
||||||
|
echo "deb https://mirrors.ustc.edu.cn/ubuntu-ports noble-security main restricted universe multiverse" >> /etc/apt/sources.list && \
|
||||||
|
echo "deb https://mirrors.ustc.edu.cn/ubuntu-ports noble-updates main restricted universe multiverse" >> /etc/apt/sources.list; \
|
||||||
|
else \
|
||||||
|
echo "deb https://mirrors.ustc.edu.cn/ubuntu noble main restricted universe multiverse" > /etc/apt/sources.list && \
|
||||||
|
echo "deb https://mirrors.ustc.edu.cn/ubuntu noble-security main restricted universe multiverse" >> /etc/apt/sources.list && \
|
||||||
|
echo "deb https://mirrors.ustc.edu.cn/ubuntu noble-updates main restricted universe multiverse" >> /etc/apt/sources.list; \
|
||||||
|
fi && \
|
||||||
apt update && \
|
apt update && \
|
||||||
|
echo "ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true" | debconf-set-selections && \
|
||||||
apt install -y --no-install-recommends \
|
apt install -y --no-install-recommends \
|
||||||
libreoffice \
|
libreoffice \
|
||||||
libreoffice-java-common \
|
libreoffice-java-common \
|
||||||
|
ttf-mscorefonts-installer \
|
||||||
fonts-dejavu \
|
fonts-dejavu \
|
||||||
fonts-noto-cjk \
|
fonts-noto-cjk \
|
||||||
fontconfig \
|
fontconfig \
|
||||||
@@ -22,6 +32,7 @@ RUN rm -f /etc/apt/sources.list.d/* && \
|
|||||||
tzdata \
|
tzdata \
|
||||||
ca-certificates && \
|
ca-certificates && \
|
||||||
locale-gen zh_CN.UTF-8 && \
|
locale-gen zh_CN.UTF-8 && \
|
||||||
|
dpkg-reconfigure --frontend noninteractive locales && \
|
||||||
rm -rf /var/lib/apt/lists/*
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# 设置工作目录
|
# 设置工作目录
|
||||||
@@ -31,7 +42,12 @@ RUN mkdir -p /app/logs
|
|||||||
# 拷贝应用文件、配置、字体
|
# 拷贝应用文件、配置、字体
|
||||||
COPY app/document-server-*.jar /app/application.jar
|
COPY app/document-server-*.jar /app/application.jar
|
||||||
COPY app/application.yml /app/application.yml
|
COPY app/application.yml /app/application.yml
|
||||||
|
|
||||||
|
# 拷贝字体文件并刷新字体缓存
|
||||||
COPY fonts /usr/share/fonts/truetype
|
COPY fonts /usr/share/fonts/truetype
|
||||||
|
RUN fc-cache -fv
|
||||||
|
|
||||||
|
# 入口
|
||||||
COPY entrypoint.sh /entrypoint.sh
|
COPY entrypoint.sh /entrypoint.sh
|
||||||
RUN chmod +x /entrypoint.sh
|
RUN chmod +x /entrypoint.sh
|
||||||
|
|
||||||
|
|||||||
@@ -2,17 +2,16 @@
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
# -----------------------------
|
# -----------------------------
|
||||||
# 可选:启动 LibreOffice headless 监听服务(端口2002)用于文档转换
|
# 临时目录权限设置、清理
|
||||||
# -----------------------------
|
# -----------------------------
|
||||||
# 你可以根据需要开启或关闭
|
chmod 1777 /tmp
|
||||||
libreoffice --headless --accept="socket,host=0.0.0.0,port=${PORT_NUMBERS};urp;" --nologo --nofirststartwizard &
|
rm -rf /tmp/.jodconverter_* || true
|
||||||
echo "LibreOffice headless started on port ${PORT_NUMBERS}"
|
|
||||||
|
|
||||||
# -----------------------------
|
# -----------------------------
|
||||||
# 启动 Java 应用
|
# 启动 Java 应用
|
||||||
# -----------------------------
|
# -----------------------------
|
||||||
echo "Starting Java application..."
|
echo "Starting Java application..."
|
||||||
rm -rf /app/start.sh
|
|
||||||
cat > /app/start.sh <<EOF
|
cat > /app/start.sh <<EOF
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
exec java -jar /app/application.jar \
|
exec java -jar /app/application.jar \
|
||||||
@@ -27,4 +26,4 @@ exec java -jar /app/application.jar \
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
chmod 755 /app/start.sh
|
chmod 755 /app/start.sh
|
||||||
sh /app/start.sh
|
exec /app/start.sh
|
||||||
Reference in New Issue
Block a user