Przeglądaj źródła

fix(docker): docker镜像制作相关

高家顺 3 lat temu
rodzic
commit
45c9561f99
3 zmienionych plików z 21 dodań i 4 usunięć
  1. 2 1
      Dockerfile
  2. 3 3
      sql/file_collect.sql
  3. 16 0
      src/main/resources/application-docker.yml

+ 2 - 1
Dockerfile

@@ -2,4 +2,5 @@ FROM java:8
 EXPOSE 8080
 ARG JAR_FILE
 ADD target/${JAR_FILE} /file-collect.jar
-ENTRYPOINT ["java", "-jar","/file-collect.jar"]
+ADD target/lib /lib
+ENTRYPOINT ["java", "-jar","-Dspring.profiles.active=docker","/file-collect.jar"]

+ 3 - 3
sql/file_collect.sql

@@ -29,7 +29,7 @@ CREATE TABLE `kr_b_line`  (
   `robot_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '机器人名称',
   `voltage` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '电压等级,例:直流220kV,交流xkV',
   `line_status` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '线路状态:在运,停运',
-  `service_begintime` datetime(0) NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '投运时间',
+  `service_begintime` datetime(0) COMMENT '投运时间',
   `begin_tower` int(11) NOT NULL DEFAULT 0 COMMENT '机器运行的起始杆塔',
   `end_tower` int(11) NOT NULL DEFAULT 0 COMMENT '机器运行的终止杆塔',
   `creator_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '创建人',
@@ -3824,11 +3824,11 @@ CREATE TABLE `kr_b_tower`  (
   `corner_direction` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '转角方向(左/右/否)否为无转角',
   `corner_number` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '转角角度',
   `span` double(11, 2) NOT NULL DEFAULT 0.00 COMMENT '档距',
-  `service_begintime` datetime(0) NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '投运时间',
+  `service_begintime` datetime(0) COMMENT '投运时间',
   `remark` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '备注说明',
   `has_file` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否存在文件',
   `creator_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '创建者id',
-  `create_time` datetime(0) NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '创建时间',
+  `create_time` datetime(0) COMMENT '创建时间',
   PRIMARY KEY (`id`) USING BTREE,
   INDEX `idx_line_id`(`line_id`) USING BTREE COMMENT '线路ID索引',
   UNIQUE INDEX `idx_line_id_idx`(`line_id`, `tower_index`) USING BTREE COMMENT '线路ID和塔索引'

+ 16 - 0
src/main/resources/application-docker.yml

@@ -0,0 +1,16 @@
+spring:
+  datasource:
+    url: jdbc:mysql://mysql:3306/file_collect?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
+    username: root
+    password: root
+  redis:
+    host: redis # Redis服务器地址
+    database: 0 # Redis数据库索引(默认为0)
+    port: 6379 # Redis服务器连接端口
+    password: # Redis服务器连接密码(默认为空)
+    timeout: 3000ms # 连接超时时间(毫秒)
+
+logging:
+  level:
+    root: info
+    com.macro.mall: debug