Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yd-oss
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xingmin
yd-oss
Commits
ff5778e4
Commit
ff5778e4
authored
Oct 13, 2025
by
zhangxingmin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
push
parent
9a940a61
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
15 deletions
+22
-15
yd-oss-api/Dockerfile
+22
-15
No files found.
yd-oss-api/Dockerfile
View file @
ff5778e4
# 基础镜像
# 基础镜像
- 使用更轻量的slim版本
FROM
openjdk:8
FROM
openjdk:8
-jre-slim
# 维护人
# 维护人
LABEL
maintainer="zxm<2060197959@qq.com>"
LABEL
maintainer="zxm<2060197959@qq.com>"
...
@@ -11,18 +11,14 @@ RUN mkdir -p /home/app
...
@@ -11,18 +11,14 @@ RUN mkdir -p /home/app
RUN
sed
-i
's/deb.debian.org/mirrors.aliyun.com/g'
/etc/apt/sources.list
&&
\
RUN
sed
-i
's/deb.debian.org/mirrors.aliyun.com/g'
/etc/apt/sources.list
&&
\
sed
-i
's/security.debian.org/mirrors.aliyun.com/g'
/etc/apt/sources.list
sed
-i
's/security.debian.org/mirrors.aliyun.com/g'
/etc/apt/sources.list
#
安装 LibreOffice 和完整的中文字体包(合并RUN命令减少层数
)
#
精简安装必要的组件(只保留核心功能
)
RUN
apt-get update
&&
\
RUN
apt-get update
&&
\
apt-get install
-y
--no-install-recommends
\
apt-get install
-y
--no-install-recommends
\
libreoffice
\
libreoffice
-core
\
libreoffice-writer
\
libreoffice-writer
\
libreoffice-l10n-zh-cn
\
libreoffice-l10n-zh-cn
\
fonts-liberation
\
fonts-dejavu
\
fonts-wqy-microhei
\
fonts-wqy-microhei
\
fonts-wqy-zenhei
\
fonts-wqy-zenhei
\
fonts-noto-cjk
\
fonts-droid-fallback
\
fontconfig
\
fontconfig
\
locales
&&
\
locales
&&
\
# 设置中文 locale
# 设置中文 locale
...
@@ -39,17 +35,29 @@ ENV LANG=zh_CN.UTF-8
...
@@ -39,17 +35,29 @@ ENV LANG=zh_CN.UTF-8
ENV
LANGUAGE=zh_CN:zh
ENV
LANGUAGE=zh_CN:zh
ENV
LC_ALL=zh_CN.UTF-8
ENV
LC_ALL=zh_CN.UTF-8
# 验证安装
# 验证安装
(只保留必要的验证)
RUN
echo
"=== 验证字体安装 ==="
&&
\
RUN
echo
"=== 验证字体安装 ==="
&&
\
fc-list :lang
=
zh | head
-5
&&
\
fc-list :lang
=
zh | head
-5
&&
\
echo
"=== 验证LibreOffice ==="
&&
\
echo
"=== 验证LibreOffice ==="
&&
\
libreoffice
--version
libreoffice
--version
| head
-1
# 拷贝项目jar
# 拷贝项目jar
(放在较晚的步骤,利用缓存)
COPY
target/yd-oss-api-1.0-SNAPSHOT-exec.jar /home/app/yd-oss-api.jar
COPY
target/yd-oss-api-1.0-SNAPSHOT-exec.jar /home/app/yd-oss-api.jar
#
执行命令启动jar
#
预生成JVM类数据共享文件,加速后续启动
ENTRYPOINT
["java", "-jar", "/home/app/yd-oss-api.jar"]
RUN
java
-Xshare
:dump
-jar
/home/app/yd-oss-api.jar
||
true
# 暴露端口
# 暴露端口
EXPOSE
9106
EXPOSE
9106
\ No newline at end of file
# 执行命令启动jar,使用优化的JVM参数
ENTRYPOINT
["java", \
"-XX:+UseContainerSupport", \
"-XX:InitialRAMPercentage=50.0", \
"-XX:MaxRAMPercentage=80.0", \
"-XX:+UseG1GC", \
"-XX:+UseStringDeduplication", \
"-XX:+TieredCompilation", \
"-XX:TieredStopAtLevel=1", \
"-Xshare:on", \
"-jar", "/home/app/yd-oss-api.jar"]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment