Browse Source

添加job-executor镜像文件

zhangqiankun 3 years ago
parent
commit
a5db42ad3a

+ 30 - 0
doc/docker/job-executor/Dockerfile

@@ -0,0 +1,30 @@
+#构建此镜像的基础镜像
+FROM registry.persagy.com/base/centos:v-jdk1.8
+#指定作者名称
+MAINTAINER lijie<lijie@persagy.com>
+
+#定义标签属性
+LABEL tier=backend
+LABEL product=integrated
+LABEL project=job-executor
+LABEL name=integrated-job
+
+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
+
+#复制文件到容器内
+RUN mkdir -p $WORKER_HOME/config
+COPY config $WORKER_HOME/config
+COPY *.jar $WORKER_HOME/
+COPY entrypoint.sh $WORKER_HOME/
+
+#设置工作目录
+WORKDIR $WORKER_HOME
+
+#查看上述复制的文件,是否复制成功
+RUN ls
+
+#启动执行
+ENTRYPOINT ["sh","./entrypoint.sh"]

+ 3 - 0
doc/docker/job-executor/entrypoint.sh

@@ -0,0 +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 job-executor.jar

+ 5 - 1
job-admin/pom.xml

@@ -9,7 +9,11 @@
 	<artifactId>job-admin</artifactId>
 	<packaging>jar</packaging>
 	<dependencies>
-
+		<dependency>
+			<groupId>org.springframework</groupId>
+	    	<artifactId>spring-core</artifactId>
+	    	<version>5.1.15.RELEASE</version>
+		</dependency>
 		<!-- starter-web:spring-webmvc + autoconfigure + logback + yaml + tomcat -->
 		<dependency>
 			<groupId>org.springframework.boot</groupId>

+ 3 - 3
job-admin/src/main/resources/application.properties

@@ -20,9 +20,9 @@ spring.freemarker.settings.number_format=0.##########
 mybatis.mapper-locations=classpath:/mybatis-mapper/*Mapper.xml
 
 ### xxl-job, datasource
-spring.datasource.url=jdbc:mysql://${SPRING_DATASOURCE_IP:1192.168.100.94}:${SPRING_DATASOURCE_PORT:9934}/${XXL_JOB_DATABASE:xxl-job}?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
-spring.datasource.username=${SPRING_DATASOURCE_USERNAME:root}
-spring.datasource.password=${SPRING_DATASOURCE_PASSWORD:persagy@2020}
+spring.datasource.url=jdbc:mysql://${SPRING_DATASOURCE_IP:192.168.100.94}:${SPRING_DATASOURCE_PORT:9934}/${XXL_JOB_DATABASE:xxl-job}?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
+spring.datasource.username=${SPRING_DATASOURCE_USERNAME:kubernetes1}
+spring.datasource.password=${SPRING_DATASOURCE_PASSWORD:J83JdNSFjfsDaDe}
 
 ### datasource-pool
 spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver

+ 5 - 0
job-executor/pom.xml

@@ -19,6 +19,11 @@
     </properties>
 
     <dependencies>
+    	<dependency>
+			<groupId>org.springframework</groupId>
+	    	<artifactId>spring-core</artifactId>
+	    	<version>5.1.15.RELEASE</version>
+		</dependency>
         <!-- spring-boot-starter-web (spring-webmvc + tomcat) -->
         <dependency>
             <groupId>org.springframework.boot</groupId>