[Change] Dockerfile.sample 调整构建指令顺序以充分利用构建缓存;

[Fix] Main 修复SystemProperties设置null抛出NPE的问题;
This commit is contained in:
LamGC 2020-05-04 17:07:39 +08:00
parent 46cb47c7d1
commit 40c5284be2
2 changed files with 4 additions and 3 deletions

View File

@ -3,7 +3,8 @@ FROM openjdk:8u252-jre
ENV jarFileName=ContentGrabbingJi-exec.jar ENV jarFileName=ContentGrabbingJi-exec.jar
ENV CGJ_REDIS_URI="127.0.0.1:6379" ENV CGJ_REDIS_URI="127.0.0.1:6379"
ENV CGJ_PROXY="" ENV CGJ_PROXY=""
COPY ${jarFileName} /CGJ.jar
RUN mkdir /data/ RUN mkdir /data/
COPY ${jarFileName} /CGJ.jar
CMD ["java", "-Dcgj.logsPath=/data/logs", "-jar", "/CGJ.jar", "botMode", "-botDataDir=/data"] CMD ["java", "-Dcgj.logsPath=/data/logs", "-jar", "/CGJ.jar", "botMode", "-botDataDir=/data"]

View File

@ -129,10 +129,10 @@ public class Main {
if(env != null) { if(env != null) {
System.setProperty("cgj." + sysPropKey, env); System.setProperty("cgj." + sysPropKey, env);
return true; return true;
} else { } else if(defaultValue != null) {
System.setProperty("cgj." + sysPropKey, defaultValue); System.setProperty("cgj." + sysPropKey, defaultValue);
return false;
} }
return false;
} }
@Command @Command