Przeglądaj źródła

客户管理配置

gaodandan 7 lat temu
rodzic
commit
f2f6a4a2cb

+ 5 - 0
Dockerfile

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

+ 6 - 1
pom.xml

@@ -45,7 +45,11 @@
45 45
 			<groupId>org.springframework.cloud</groupId>
46 46
 			<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
47 47
 		</dependency>
48
-
48
+		<dependency>
49
+            <groupId>org.springframework.cloud</groupId>
50
+            <artifactId>spring-cloud-starter-config</artifactId>
51
+        </dependency>
52
+		
49 53
 		<dependency>
50 54
 			<groupId>org.apache.commons</groupId>
51 55
 			<artifactId>commons-lang3</artifactId>
@@ -88,6 +92,7 @@
88 92
 	</dependencyManagement>
89 93
 
90 94
 	<build>
95
+		<finalName>${project.artifactId}</finalName>
91 96
 		<plugins>
92 97
 			<plugin>
93 98
 				<groupId>org.springframework.boot</groupId>

+ 2 - 0
src/main/java/com/chinaitop/depot/DepotCustomerApplication.java

@@ -3,9 +3,11 @@ package com.chinaitop.depot;
3 3
 import org.mybatis.spring.annotation.MapperScan;
4 4
 import org.springframework.boot.SpringApplication;
5 5
 import org.springframework.boot.autoconfigure.SpringBootApplication;
6
+import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
6 7
 import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
7 8
 
8 9
 @EnableEurekaClient
10
+@EnableDiscoveryClient
9 11
 @SpringBootApplication
10 12
 @MapperScan(basePackages = {"com.chinaitop.depot.*.mapper"})
11 13
 public class DepotCustomerApplication {

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

@@ -1,16 +0,0 @@
1
-server.port=9006
2
-
3
-# 配置库级应用数据源
4
-spring.datasource.driverClassName = com.mysql.jdbc.Driver
5
-spring.datasource.url = jdbc:mysql://192.168.80.25:3306/depot_yn?useUnicode=true&characterEncoding=utf-8
6
-spring.datasource.username = root
7
-spring.datasource.password = 123456
8
-
9
-
10
-eureka.client.serviceUrl.defaultZone=http://192.168.80.25:9001/eureka/
11
-spring.application.name=depot-customer
12
-
13
-eureka.instance.status-page-url=http://192.168.80.25:${server.port}/swagger-ui.html
14
-
15
-#服务器图片保存位置
16
-web.upload-path=D:/depotImg/

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

@@ -0,0 +1,25 @@
1
+server:
2
+  port: 9006
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-customer
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