update 优化 Dockerfile 使用shell模式 支持环境变量传入jvm参数

2.X
疯狂的狮子Li 1 year ago
parent 79efa12569
commit ef972b7ab1

@ -9,16 +9,15 @@ RUN mkdir -p /ruoyi/auth/logs \
WORKDIR /ruoyi/auth
ENV SERVER_PORT=9210 LANG=C.UTF-8 LC_ALL=C.UTF-8
ENV SERVER_PORT=9210 LANG=C.UTF-8 LC_ALL=C.UTF-8 JAVA_OPTS=""
EXPOSE ${SERVER_PORT}
ADD ./target/ruoyi-auth.jar ./app.jar
ENTRYPOINT ["java", \
"-Djava.security.egd=file:/dev/./urandom", \
"-Dserver.port=${SERVER_PORT}", \
# "-Dskywalking.agent.service_name=ruoyi-auth", \
# "-javaagent:/ruoyi/skywalking/agent/skywalking-agent.jar", \
"-jar", "app.jar",
"-XX:+HeapDumpOnOutOfMemoryError", "-Xlog:gc*,:time,tags,level", "-XX:+UseZGC"]
ENTRYPOINT java -Djava.security.egd=file:/dev/./urandom -Dserver.port=${SERVER_PORT} \
#-Dskywalking.agent.service_name=ruoyi-auth \
#-javaagent:/ruoyi/skywalking/agent/skywalking-agent.jar \
-jar app.jar \
-XX:+HeapDumpOnOutOfMemoryError -Xlog:gc*,:time,tags,level -XX:+UseZGC ${JAVA_OPTS}

@ -9,16 +9,14 @@ RUN mkdir -p /ruoyi/gateway/logs \
WORKDIR /ruoyi/gateway
ENV SERVER_PORT=8080 LANG=C.UTF-8 LC_ALL=C.UTF-8
ENV SERVER_PORT=8080 LANG=C.UTF-8 LC_ALL=C.UTF-8 JAVA_OPTS=""
EXPOSE ${SERVER_PORT}
ADD ./target/ruoyi-gateway.jar ./app.jar
ENTRYPOINT ["java", \
"-Djava.security.egd=file:/dev/./urandom", \
"-Dserver.port=${SERVER_PORT}", \
# "-Dskywalking.agent.service_name=ruoyi-gateway", \
# "-javaagent:/ruoyi/skywalking/agent/skywalking-agent.jar", \
"-jar", "app.jar",
"-XX:+HeapDumpOnOutOfMemoryError", "-Xlog:gc*,:time,tags,level", "-XX:+UseZGC"]
ENTRYPOINT java -Djava.security.egd=file:/dev/./urandom -Dserver.port=${SERVER_PORT} \
#-Dskywalking.agent.service_name=ruoyi-gateway \
#-javaagent:/ruoyi/skywalking/agent/skywalking-agent.jar \
-jar app.jar \
-XX:+HeapDumpOnOutOfMemoryError -Xlog:gc*,:time,tags,level -XX:+UseZGC ${JAVA_OPTS}

@ -7,10 +7,10 @@ RUN mkdir -p /ruoyi/gen/logs
WORKDIR /ruoyi/gen
ENV SERVER_PORT=9202 LANG=C.UTF-8 LC_ALL=C.UTF-8
ENV SERVER_PORT=9202 LANG=C.UTF-8 LC_ALL=C.UTF-8 JAVA_OPTS=""
EXPOSE ${SERVER_PORT}
ADD ./target/ruoyi-gen.jar ./app.jar
ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-Dserver.port=${SERVER_PORT}", "-jar", "app.jar"]
ENTRYPOINT java -Djava.security.egd=file:/dev/./urandom -Dserver.port=${SERVER_PORT} -jar app.jar ${JAVA_OPTS}

@ -9,16 +9,15 @@ RUN mkdir -p /ruoyi/job/logs \
WORKDIR /ruoyi/job
ENV SERVER_PORT=9203 LANG=C.UTF-8 LC_ALL=C.UTF-8
ENV SERVER_PORT=9203 LANG=C.UTF-8 LC_ALL=C.UTF-8 JAVA_OPTS=""
EXPOSE ${SERVER_PORT}
ADD ./target/ruoyi-job.jar ./app.jar
ENTRYPOINT ["java", \
"-Djava.security.egd=file:/dev/./urandom", \
"-Dserver.port=${SERVER_PORT}", \
# "-Dskywalking.agent.service_name=ruoyi-job", \
# "-javaagent:/ruoyi/skywalking/agent/skywalking-agent.jar", \
"-jar", "app.jar",
"-XX:+HeapDumpOnOutOfMemoryError", "-Xlog:gc*,:time,tags,level", "-XX:+UseZGC"]
ENTRYPOINT java -Djava.security.egd=file:/dev/./urandom -Dserver.port=${SERVER_PORT} \
#-Dskywalking.agent.service_name=ruoyi-job \
#-javaagent:/ruoyi/skywalking/agent/skywalking-agent.jar \
-jar app.jar \
-XX:+HeapDumpOnOutOfMemoryError -Xlog:gc*,:time,tags,level -XX:+UseZGC ${JAVA_OPTS}

@ -9,16 +9,15 @@ RUN mkdir -p /ruoyi/resource/logs \
WORKDIR /ruoyi/resource
ENV SERVER_PORT=9204 LANG=C.UTF-8 LC_ALL=C.UTF-8
ENV SERVER_PORT=9204 LANG=C.UTF-8 LC_ALL=C.UTF-8 JAVA_OPTS=""
EXPOSE ${SERVER_PORT}
ADD ./target/ruoyi-resource.jar ./app.jar
ENTRYPOINT ["java", \
"-Djava.security.egd=file:/dev/./urandom", \
"-Dserver.port=${SERVER_PORT}", \
# "-Dskywalking.agent.service_name=ruoyi-resource", \
# "-javaagent:/ruoyi/skywalking/agent/skywalking-agent.jar", \
"-jar", "app.jar",
"-XX:+HeapDumpOnOutOfMemoryError", "-Xlog:gc*,:time,tags,level", "-XX:+UseZGC"]
ENTRYPOINT java -Djava.security.egd=file:/dev/./urandom -Dserver.port=${SERVER_PORT} \
#-Dskywalking.agent.service_name=ruoyi-resource \
#-javaagent:/ruoyi/skywalking/agent/skywalking-agent.jar \
-jar app.jar \
-XX:+HeapDumpOnOutOfMemoryError -Xlog:gc*,:time,tags,level -XX:+UseZGC ${JAVA_OPTS}

@ -9,16 +9,15 @@ RUN mkdir -p /ruoyi/system/logs \
WORKDIR /ruoyi/system
ENV SERVER_PORT=9201 LANG=C.UTF-8 LC_ALL=C.UTF-8
ENV SERVER_PORT=9201 LANG=C.UTF-8 LC_ALL=C.UTF-8 JAVA_OPTS=""
EXPOSE ${SERVER_PORT}
ADD ./target/ruoyi-system.jar ./app.jar
ENTRYPOINT ["java", \
"-Djava.security.egd=file:/dev/./urandom", \
"-Dserver.port=${SERVER_PORT}", \
# "-Dskywalking.agent.service_name=ruoyi-system", \
# "-javaagent:/ruoyi/skywalking/agent/skywalking-agent.jar", \
"-jar", "app.jar",
"-XX:+HeapDumpOnOutOfMemoryError", "-Xlog:gc*,:time,tags,level", "-XX:+UseZGC"]
ENTRYPOINT java -Djava.security.egd=file:/dev/./urandom -Dserver.port=${SERVER_PORT} \
#-Dskywalking.agent.service_name=ruoyi-system \
#-javaagent:/ruoyi/skywalking/agent/skywalking-agent.jar \
-jar app.jar \
-XX:+HeapDumpOnOutOfMemoryError -Xlog:gc*,:time,tags,level -XX:+UseZGC ${JAVA_OPTS}

@ -7,11 +7,11 @@ RUN mkdir -p /ruoyi/monitor/logs
WORKDIR /ruoyi/monitor
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8 JAVA_OPTS=""
EXPOSE 9100
ADD ./target/ruoyi-monitor.jar ./app.jar
ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-jar", "app.jar",
"-XX:+HeapDumpOnOutOfMemoryError", "-Xlog:gc*,:time,tags,level", "-XX:+UseZGC"]
ENTRYPOINT java -Djava.security.egd=file:/dev/./urandom -jar app.jar \
-XX:+HeapDumpOnOutOfMemoryError -Xlog:gc*,:time,tags,level -XX:+UseZGC ${JAVA_OPTS}

@ -9,10 +9,10 @@ WORKDIR /ruoyi/nacos
EXPOSE 8848
ENV TZ=Asia/Shanghai LANG=C.UTF-8 LC_ALL=C.UTF-8
ENV TZ=Asia/Shanghai LANG=C.UTF-8 LC_ALL=C.UTF-8 JAVA_OPTS="-Xms512m -Xmx1024m"
ADD ./target/ruoyi-nacos.jar ./app.jar
ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-jar", "app.jar",
"-Xms512m", "-Xmx1024m", "-XX:+HeapDumpOnOutOfMemoryError", "-Xlog:gc*,:time,tags,level", "-XX:+UseZGC"]
ENTRYPOINT java -Djava.security.egd=file:/dev/./urandom -jar app.jar \
-XX:+HeapDumpOnOutOfMemoryError -Xlog:gc*,:time,tags,level -XX:+UseZGC ${JAVA_OPTS}

@ -7,11 +7,11 @@ RUN mkdir -p /ruoyi/powerjob/logs
WORKDIR /ruoyi/powerjob
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8 JAVA_OPTS="-Xms512m -Xmx1024m"
EXPOSE 7700
ADD ./target/ruoyi-powerjob-server.jar ./app.jar
ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-jar", "app.jar",
"-XX:+HeapDumpOnOutOfMemoryError", "-Xlog:gc*,:time,tags,level", "-XX:+UseZGC"]
ENTRYPOINT java -Djava.security.egd=file:/dev/./urandom -jar app.jar \
-XX:+HeapDumpOnOutOfMemoryError -Xlog:gc*,:time,tags,level -XX:+UseZGC ${JAVA_OPTS}

@ -8,7 +8,7 @@ RUN mkdir -p /ruoyi/seata-server/logs \
WORKDIR /ruoyi/seata-server
ENV TZ=PRC LANG=C.UTF-8 LC_ALL=C.UTF-8
ENV TZ=PRC LANG=C.UTF-8 LC_ALL=C.UTF-8 JAVA_OPTS=""
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
EXPOSE 7091
@ -16,10 +16,9 @@ EXPOSE 8091
ADD ./target/ruoyi-seata-server.jar ./app.jar
ENTRYPOINT ["java", \
"-Djava.security.egd=file:/dev/./urandom", \
# "-Dskywalking.agent.service_name=ruoyi-seata-server", \
# "-Dskywalking.plugin.seata.server=true", \
# "-javaagent:/ruoyi/skywalking/agent/skywalking-agent.jar", \
"-jar", "app.jar",
"-XX:+HeapDumpOnOutOfMemoryError", "-Xlog:gc*,:time,tags,level", "-XX:+UseZGC"]
ENTRYPOINT java -Djava.security.egd=file:/dev/./urandom \
#-Dskywalking.agent.service_name=ruoyi-seata-server", \
#-Dskywalking.plugin.seata.server=true", \
#-javaagent:/ruoyi/skywalking/agent/skywalking-agent.jar", \
-jar app.jar \
-XX:+HeapDumpOnOutOfMemoryError -Xlog:gc*,:time,tags,level -XX:+UseZGC ${JAVA_OPTS}

@ -8,15 +8,14 @@ RUN mkdir -p /ruoyi/sentinel-dashboard/logs \
WORKDIR /ruoyi/sentinel-dashboard
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8 JAVA_OPTS=""
EXPOSE 8718
ADD ./target/ruoyi-sentinel-dashboard.jar ./app.jar
ENTRYPOINT ["java", \
"-Djava.security.egd=file:/dev/./urandom", \
# "-Dskywalking.agent.service_name=ruoyi-sentinel-dashboard", \
# "-javaagent:/ruoyi/skywalking/agent/skywalking-agent.jar", \
"-jar", "app.jar",
"-XX:+HeapDumpOnOutOfMemoryError", "-Xlog:gc*,:time,tags,level", "-XX:+UseZGC"]
ENTRYPOINT java -Djava.security.egd=file:/dev/./urandom -Dserver.port=${SERVER_PORT} \
#-Dskywalking.agent.service_name=ruoyi-sentinel-dashboard \
#-javaagent:/ruoyi/skywalking/agent/skywalking-agent.jar \
-jar app.jar \
-XX:+HeapDumpOnOutOfMemoryError -Xlog:gc*,:time,tags,level -XX:+UseZGC ${JAVA_OPTS}

Loading…
Cancel
Save