限制内存使用大小

This commit is contained in:
yuzl6 2024-04-08 09:08:29 +08:00
parent a53709481c
commit 54b134e942
3 changed files with 17 additions and 3 deletions

View File

@ -3,6 +3,10 @@ FROM registry.cn-qingdao.aliyuncs.com/yuzl1/jdk:21
# 将本地文件复制到容器中
COPY target/ruoyi-admin.jar /ruoyi-admin.jar
# 设置环境变量
ENV JAVA_OPTS="-server -Xms512m -Xmx512m"
# 时区设置
RUN echo "Asia/shanghai" > /etc/timezone
# 运行应用
ENTRYPOINT ["java","-jar","/ruoyi-admin.jar"]
ENTRYPOINT exec java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /ruoyi-admin.jar

View File

@ -4,5 +4,10 @@ FROM registry.cn-qingdao.aliyuncs.com/yuzl1/jdk:21
# 将本地文件复制到容器中
COPY target/ruoyi-monitor.jar /ruoyi-monitor.jar
# 设置环境变量
ENV JAVA_OPTS="-server -Xms512m -Xmx512m"
# 时区设置
RUN echo "Asia/shanghai" > /etc/timezone
# 运行应用
ENTRYPOINT ["java","-jar","/ruoyi-monitor.jar"]
ENTRYPOINT exec java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /ruoyi-monitor.jar

View File

@ -4,5 +4,10 @@ FROM registry.cn-qingdao.aliyuncs.com/yuzl1/jdk:21
# 将本地文件复制到容器中
COPY target/ruoyi-powerjob-server.jar /ruoyi-powerjob-server.jar
# 设置环境变量
ENV JAVA_OPTS="-server -Xms512m -Xmx512m"
# 时区设置
RUN echo "Asia/shanghai" > /etc/timezone
# 运行应用
ENTRYPOINT ["java","-jar","/ruoyi-powerjob-server.jar"]
ENTRYPOINT exec java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /ruoyi-powerjob-server.jar