Browse Source

修改dockerfile文件路径

zhangqiankun 3 years ago
parent
commit
a4450083b2
2 changed files with 9 additions and 13 deletions
  1. 8 12
      job-admin/Dockerfile
  2. 1 1
      job-admin/entrypoint.sh

+ 8 - 12
job-admin/Dockerfile

@@ -9,21 +9,17 @@ LABEL product=integrated
 LABEL project=job-admin
 LABEL name=integrated-job
 
-#设置环境变量
-ENV TZ Asia/Shanghai
-#ARG 可以接收docker build命令中以--build-arg 指定的参数
-ENV WORKER_HOME /mnt/integrated/job-admin
-
-#执行的命令
-RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime	&& echo 'Asia/Shanghai' > /etc/timezone
-
-RUN mkdir -p $WORKER_HOME/config
+ARG WORKER_HOME
+ENV TZ=Asia/Shanghai
+ENV JAVA_OPTS -XX:+UseContainerSupport -XX:MaxRAMPercentage=75.0 -XX:InitialRAMPercentage=75.0 -XX:MinRAMPercentage=75.0
+RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezon
 
 #复制文件到容器内
-COPY target/*.jar $WORKER_HOME/app.jar
+RUN mkdir -p $WORKER_HOME/config
+COPY config $WORKER_HOME/config
+COPY *.jar $WORKER_HOME/
 COPY entrypoint.sh $WORKER_HOME/
-#COPY version.txt $WORKER_HOME/
-#COPY config $WORKER_HOME/config
+
 #设置工作目录
 WORKDIR $WORKER_HOME
 

+ 1 - 1
job-admin/entrypoint.sh

@@ -1,3 +1,3 @@
 #!/bin/bash
 echo "entrypoint run..."
-java -jar $JAVA_OPTS -Dfile.encoding=UTF-8 -Dconsole.encoding=UTF-8 -Dserver.port=$SERVER_PORT -Deureka.client.service-url.defaultZone=$EUREKA_CLIENT_DEFAULT_ZONE -Dspring.cloud.config.profile=$SPRING_CLOUD_CONFIG_PROFILE -Dspring.cloud.config.uri=$SPRING_CLOUD_CONFIG_URI app.jar
+java -jar $JAVA_OPTS -Dfile.encoding=UTF-8 -Dconsole.encoding=UTF-8 -Dserver.port=$SERVER_PORT -Deureka.client.service-url.defaultZone=$EUREKA_CLIENT_DEFAULT_ZONE -Dspring.cloud.config.profile=$SPRING_CLOUD_CONFIG_PROFILE -Dspring.cloud.config.uri=$SPRING_CLOUD_CONFIG_URI job-admin.jar