Commit 6fa5d63b by zhangxingmin

push

parent 81fffd22
# 构建阶段 - 创建包含LibreOffice的基础镜像 # ============================================================
# 构建阶段 - 创建包含 LibreOffice 的基础镜像
# ============================================================
FROM openjdk:8-jre-slim as base-builder FROM openjdk:8-jre-slim as base-builder
ENV LANG=zh_CN.UTF-8 \ ENV LANG=zh_CN.UTF-8 \
...@@ -6,10 +8,12 @@ ENV LANG=zh_CN.UTF-8 \ ...@@ -6,10 +8,12 @@ ENV LANG=zh_CN.UTF-8 \
LC_ALL=zh_CN.UTF-8 \ LC_ALL=zh_CN.UTF-8 \
DEBIAN_FRONTEND=noninteractive DEBIAN_FRONTEND=noninteractive
RUN sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list && \ # 替换为清华源(比 aliyun 更稳定,Release 文件更新及时)
sed -i 's/security.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list # 同时加上 -o Acquire::Check-Valid-Until=false 作为双保险,避免 Release 过期导致失败
RUN sed -i 's|deb.debian.org|mirrors.tuna.tsinghua.edu.cn|g' /etc/apt/sources.list && \
sed -i 's|security.debian.org|mirrors.tuna.tsinghua.edu.cn/debian-security|g' /etc/apt/sources.list
RUN apt-get update && \ RUN apt-get update -o Acquire::Check-Valid-Until=false && \
apt-get install -y --no-install-recommends \ apt-get install -y --no-install-recommends \
fonts-liberation \ fonts-liberation \
fonts-dejavu-core \ fonts-dejavu-core \
...@@ -29,12 +33,15 @@ RUN apt-get update && \ ...@@ -29,12 +33,15 @@ RUN apt-get update && \
RUN mkdir -p /home/app RUN mkdir -p /home/app
WORKDIR /home/app WORKDIR /home/app
# ============================================================
# 最终阶段 # 最终阶段
# ============================================================
FROM base-builder FROM base-builder
# 只拷贝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内存参数 # 启动命令,设置 JVM 内存参数
ENTRYPOINT ["java", "-Xmx1024m", "-Xms512m", "-jar", "/home/app/yd-oss-api.jar"] ENTRYPOINT ["java", "-Xmx1024m", "-Xms512m", "-jar", "/home/app/yd-oss-api.jar"]
EXPOSE 9106 EXPOSE 9106
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment