ソースを参照

Dockerfile文件提交以及环境修改

nahida 1 年間 前
コミット
7cde6385e6

+ 1 - 0
.gitignore

@@ -6,6 +6,7 @@ logs/
 logs
 
 ### IntelliJ IDEA ###
+.idea
 .idea/modules.xml
 .idea/jarRepositories.xml
 .idea/compiler.xml

+ 9 - 0
environment-data-service/Dockerfile

@@ -0,0 +1,9 @@
+# 基础镜像
+FROM openjdk:11.0-jre-buster
+# 设定时区
+ENV TZ=Asia/Shanghai
+RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
+# 拷贝jar包
+COPY environment-data-service.jar /app.jar
+# 入口
+ENTRYPOINT ["java", "-Xms256m", "-Xmx512m", "-jar", "/app.jar"]

+ 9 - 0
pole-service/Dockerfile

@@ -0,0 +1,9 @@
+# 基础镜像
+FROM openjdk:11.0-jre-buster
+# 设定时区
+ENV TZ=Asia/Shanghai
+RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
+# 拷贝jar包
+COPY pole-service.jar /app.jar
+# 入口
+ENTRYPOINT ["java", "-Xms256m", "-Xmx512m", "-jar", "/app.jar"]

+ 0 - 3
pole-service/src/main/java/com/zksy/pole/MQTTServer/callBack/BootNettyMqttMsgBack.java

@@ -1,19 +1,16 @@
 package com.zksy.pole.MQTTServer.callBack;
 
 import cn.hutool.core.util.StrUtil;
-import cn.hutool.json.JSONUtil;
 import com.alibaba.fastjson.JSONObject;
 
 import com.zksy.pole.MQTTServer.config.MQTTServerProperties;
 import com.zksy.pole.MQTTServer.server.MQTTServer;
 import com.zksy.pole.factory.HandleCmdFactory;
-import com.zksy.pole.mapper.DgGatewayRegistrationMapper;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import io.netty.channel.Channel;
 import io.netty.handler.codec.mqtt.*;
 import lombok.RequiredArgsConstructor;
-import org.redisson.api.RedissonClient;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;

+ 8 - 2
pole-service/src/main/resources/application-dev.yaml

@@ -9,6 +9,12 @@ spring:
   redis:
     host: 192.168.110.30
     port: 6379
+  cloud:
+    nacos:
+      discovery:
+        server-addr: 192.168.110.30:8848
+      config:
+        server-addr: 192.168.110.30:8848
 minio:
   endpoint: http://192.168.110.30:9000
   accessKey: minio
@@ -25,5 +31,5 @@ netty:
     port: 1996
     # 传输模式linux上开启会有更高的性能
     use-epoll: false
-
-
+redisson:
+  host: redis://192.168.110.30:6379

+ 9 - 7
pole-service/src/main/resources/application-prod.yaml

@@ -1,20 +1,20 @@
 zksy:
   db:
-    host: 192.168.110.30
+    host: 172.16.102.51
     un: root
-    pw: 123
-    port: 3307
+    pw: d$3%#*(jnhUDGHB]z0x876c~
+    port: 3306
     database: zhongkeshengyang
 spring:
   redis:
-    host: 192.168.110.30
+    host: 172.16.102.52
     port: 6379
 minio:
-  endpoint: http://192.168.110.30:9000
+  endpoint: http://172.16.102.52:9000
   accessKey: minio
   secretKey: minio123
   bucket: test
-  readPath: http://192.168.110.30:9000
+  readPath: http://172.16.102.52:9000
 netty:
   mqtt:
     port: 1884
@@ -24,4 +24,6 @@ netty:
     host: 127.0.0.1
     port: 1996
     # 传输模式linux上开启会有更高的性能
-    use-epoll: false
+    use-epoll: false
+redisson:
+  host: redis://172.16.102.52:6379

+ 6 - 6
pole-service/src/main/resources/bootstrap.yaml

@@ -2,23 +2,23 @@ spring:
   application:
     name: pole-service
   profiles:
-    active: dev
+    active: prod
   main:
     allow-bean-definition-overriding: true
   cloud:
     sentinel:
       transport:
-        dashboard: 192.168.110.30:8090
+        dashboard: 172.16.102.52:8090
       http-method-specify: true
     nacos:
       discovery:
-        server-addr: 192.168.110.30:8848
+        server-addr: 172.16.102.52:8848
+        namespace: 99a7b129-faed-4b32-bcbf-54acd7ffd372
       config:
-        server-addr: 192.168.110.30:8848
+        server-addr: 172.16.102.52:8848
+        namespace: 99a7b129-faed-4b32-bcbf-54acd7ffd372
         file-extension: yaml
         shared-configs:
           - dataId: pole-service.yaml
           - dataId: zksy-shared-jdbc.yaml
           - dataId: zksy-shared-log.yaml
-redisson:
-  host: redis://192.168.110.30:6379

+ 9 - 0
visualization-service/Dockerfile

@@ -0,0 +1,9 @@
+# 基础镜像
+FROM openjdk:11.0-jre-buster
+# 设定时区
+ENV TZ=Asia/Shanghai
+RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
+# 拷贝jar包
+COPY visualization-service.jar /app.jar
+# 入口
+ENTRYPOINT ["java", "-Xms256m", "-Xmx512m", "-jar", "/app.jar"]

+ 9 - 0
zksy-gateway/Dockerfile

@@ -0,0 +1,9 @@
+# 基础镜像
+FROM openjdk:11.0-jre-buster
+# 设定时区
+ENV TZ=Asia/Shanghai
+RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
+# 拷贝jar包
+COPY zksy-gateway.jar /app.jar
+# 入口
+ENTRYPOINT ["java", "-Xms256m", "-Xmx512m", "-jar", "/app.jar"]

+ 1 - 0
zksy-gateway/src/main/java/com/zksy/gateway/GatewayApplication.java

@@ -7,5 +7,6 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
 public class GatewayApplication {
     public static void main(String[] args) {
         SpringApplication.run(GatewayApplication.class, args);
+        System.out.println("网关服务启动成功");
     }
 }

+ 21 - 0
zksy-gateway/src/main/resources/application-dev.yaml

@@ -0,0 +1,21 @@
+server:
+  port: 8080 # 端口
+hm:
+  jwt:
+    location: classpath:hmall.jks # 秘钥地址
+    alias: hmall # 秘钥别名
+    password: hmall123 # 秘钥文件密码
+    tokenTTL: 30m # 登录有效期
+  auth:
+    excludePaths: # 无需登录校验的路径
+      - /search/**
+      - /users/login
+      - /items/**
+spring:
+  cloud:
+    nacos:
+      server-addr: 192.168.110.30:8848
+      discovery:
+        server-addr: 192.168.110.30:8848
+      config:
+        server-addr: 192.168.110.30:8848

+ 0 - 0
zksy-gateway/src/main/resources/application.yaml → zksy-gateway/src/main/resources/application-prod.yaml


+ 8 - 1
zksy-gateway/src/main/resources/bootstrap.yaml

@@ -1,10 +1,17 @@
 spring:
   application:
     name: zksy-gateway
+  profiles:
+    active: prod
   cloud:
     nacos:
-      server-addr: 192.168.110.30
+      server-addr: 172.16.102.52:8848
+      discovery:
+        namespace: 99a7b129-faed-4b32-bcbf-54acd7ffd372
+        server-addr: 172.16.102.52:8848
       config:
+        server-addr: 172.16.102.52:8848
+        namespace: 99a7b129-faed-4b32-bcbf-54acd7ffd372
         file-extension: yaml
         shared-configs:
           - dataId: zksy-log.yaml # 共享日志配置