gaodandan 7 anos atrás
pai
commit
62c708239c

+ 5 - 0
Dockerfile

@@ -0,0 +1,5 @@
1
+FROM 192.168.123.25:31104/unis/java:8
2
+ 
3
+ADD ./target/depot-business.jar /root
4
+CMD ["sh", "-c", "cd /root; java -Djava.security.egd=file:/dev/./urandom -jar /root/depot-business.jar --depot-business.server.enable-self-preservation=false"]
5
+EXPOSE 9002

+ 6 - 1
pom.xml

@@ -6,7 +6,7 @@
6 6
 	<groupId>com.chinaitop</groupId>
7 7
 	<artifactId>depot-business</artifactId>
8 8
 	<version>0.0.1-SNAPSHOT</version>
9
-	<packaging>war</packaging>
9
+	<packaging>jar</packaging>
10 10
 
11 11
 	<name>depot-business</name>
12 12
 	<description>Demo project for Spring Boot</description>
@@ -120,6 +120,11 @@
120 120
 			<artifactId>pagehelper-spring-boot-starter</artifactId>
121 121
 			<version>1.2.3</version>
122 122
 		</dependency>
123
+		
124
+		<dependency>
125
+            <groupId>org.springframework.cloud</groupId>
126
+            <artifactId>spring-cloud-starter-config</artifactId>
127
+        </dependency>
123 128
 		<dependency>
124 129
 			<groupId>org.apache.commons</groupId>
125 130
 			<artifactId>commons-lang3</artifactId>

+ 2 - 0
src/main/java/com/chinaitop/DepotBusinessApplication.java

@@ -4,12 +4,14 @@ import org.mybatis.spring.annotation.MapperScan;
4 4
 import org.springframework.boot.SpringApplication;
5 5
 import org.springframework.boot.autoconfigure.SpringBootApplication;
6 6
 import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
7
+import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
7 8
 import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
8 9
 
9 10
 import springfox.documentation.swagger2.annotations.EnableSwagger2;
10 11
 
11 12
 
12 13
 @EnableEurekaClient
14
+@EnableDiscoveryClient
13 15
 @EnableSwagger2
14 16
 @SpringBootApplication(
15 17
 		exclude = {DataSourceAutoConfiguration.class}	// 禁止自动配置数据源,多数据源需采用手动配置

+ 0 - 38
src/main/resources/application.properties

@@ -1,38 +0,0 @@
1
-server.port=9002
2
-
3
-# ���ÿ⼶Ӧ������Դ
4
-spring.datasource.depot.driverClassName = com.mysql.jdbc.Driver
5
-spring.datasource.depot.url = jdbc:mysql://192.168.80.25:3306/depot?useUnicode=true&characterEncoding=utf-8
6
-spring.datasource.depot.username = root
7
-spring.datasource.depot.password = 123456
8
-
9
-spring.datasource.agile.driverClassName = com.mysql.jdbc.Driver
10
-spring.datasource.agile.url = jdbc:mysql://192.168.80.25:3306/lsreport_ts?useUnicode=true&characterEncoding=utf-8
11
-spring.datasource.agile.username = root
12
-spring.datasource.agile.password = 123456
13
-
14
-
15
-eureka.client.serviceUrl.defaultZone=http://localhost:9001/eureka/
16
-spring.application.name=depot-business
17
-
18
-eureka.instance.status-page-url=http://localhost:${server.port}/swagger-ui.html
19
-
20
-#文件上传与下载
21
-web.upload-path=D:/depotImg/
22
-spring.resources.static-locations=classpath:/META-INF/resources/,classpath:/resources/,classpath:/static/,classpath:/public/,file:${web.upload-path}
23
-
24
-#activiti
25
-spring.activiti.check-process-definitions=false
26
-
27
-
28
-#
29
-spring.http.multipart.maxFileSize=10Mb
30
-spring.http.multipart.maxRequestSize=10Mb
31
-
32
-#省级平台接口地址
33
-reportUrl = http://10.3.38.34:8087/api
34
-
35
-
36
-
37
-
38
-

+ 25 - 0
src/main/resources/bootstrap.yml

@@ -0,0 +1,25 @@
1
+server:
2
+  port: 9002
3
+  tomcat:
4
+    uri-encoding: utf-8
5
+ 
6
+# 注册中心配置
7
+eureka:
8
+  client:
9
+    service-url:
10
+      defaultZone: http://eureka-depot:9001/eureka/
11
+  instance:
12
+    prefer-ip-address: true
13
+ 
14
+spring:
15
+  application:
16
+    name: depot-business
17
+  #配置中心配置
18
+  cloud:
19
+    config:
20
+      #使用discovery 时需要将eureka 写到该文件中,开发环境使用该方式,推荐使用。
21
+      discovery:
22
+        enabled: true
23
+        service-id: depot-config-server
24
+      profile: dev
25
+      label: master