Commit 26984f7be3701f9fcdc11dd78d2a3c2b1575be21

Authored by zhangdaiscott
1 parent 15c7ea61

docker-compose 微服务脚本

jeecg-boot/db/Dockerfile
... ... @@ -6,4 +6,6 @@ ENV TZ=Asia/Shanghai
6 6  
7 7 RUN ln -sf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
8 8  
9   -COPY ./jeecgboot-mysql-5.7.sql /docker-entrypoint-initdb.d
10 9 \ No newline at end of file
  10 +COPY ./jeecgboot-mysql-5.7.sql /docker-entrypoint-initdb.d
  11 +
  12 +COPY ./tables_xxl_job.sql /docker-entrypoint-initdb.d
11 13 \ No newline at end of file
... ...
jeecg-boot/db/jeecgboot-mysql-5.7.sql
  1 +-- 创建mysql库
  2 +DROP DATABASE IF EXISTS `jeecg-boot`;
  3 +create database `jeecg-boot` default character set utf8mb4 collate utf8mb4_general_ci;
  4 +
1 5 /*
2 6 Navicat Premium Data Transfer
3 7  
... ... @@ -16,6 +20,7 @@
16 20  
17 21 SET NAMES utf8mb4;
18 22 SET FOREIGN_KEY_CHECKS = 0;
  23 +USE `jeecg-boot`;
19 24  
20 25 -- ----------------------------
21 26 -- Table structure for ces_field_kongj
... ...
jeecg-boot/db/tables_xxl_job.sql 0 → 100644
  1 +#
  2 +# XXL-JOB v2.2.0
  3 +# Copyright (c) 2015-present, xuxueli.
  4 +
  5 +CREATE database if NOT EXISTS `xxl_job` default character set utf8mb4 collate utf8mb4_unicode_ci;
  6 +use `xxl_job`;
  7 +
  8 +SET NAMES utf8mb4;
  9 +
  10 +CREATE TABLE `xxl_job_info` (
  11 + `id` int(11) NOT NULL AUTO_INCREMENT,
  12 + `job_group` int(11) NOT NULL COMMENT '执行器主键ID',
  13 + `job_cron` varchar(128) NOT NULL COMMENT '任务执行CRON',
  14 + `job_desc` varchar(255) NOT NULL,
  15 + `add_time` datetime DEFAULT NULL,
  16 + `update_time` datetime DEFAULT NULL,
  17 + `author` varchar(64) DEFAULT NULL COMMENT '作者',
  18 + `alarm_email` varchar(255) DEFAULT NULL COMMENT '报警邮件',
  19 + `executor_route_strategy` varchar(50) DEFAULT NULL COMMENT '执行器路由策略',
  20 + `executor_handler` varchar(255) DEFAULT NULL COMMENT '执行器任务handler',
  21 + `executor_param` varchar(512) DEFAULT NULL COMMENT '执行器任务参数',
  22 + `executor_block_strategy` varchar(50) DEFAULT NULL COMMENT '阻塞处理策略',
  23 + `executor_timeout` int(11) NOT NULL DEFAULT '0' COMMENT '任务执行超时时间,单位秒',
  24 + `executor_fail_retry_count` int(11) NOT NULL DEFAULT '0' COMMENT '失败重试次数',
  25 + `glue_type` varchar(50) NOT NULL COMMENT 'GLUE类型',
  26 + `glue_source` mediumtext COMMENT 'GLUE源代码',
  27 + `glue_remark` varchar(128) DEFAULT NULL COMMENT 'GLUE备注',
  28 + `glue_updatetime` datetime DEFAULT NULL COMMENT 'GLUE更新时间',
  29 + `child_jobid` varchar(255) DEFAULT NULL COMMENT '子任务ID,多个逗号分隔',
  30 + `trigger_status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '调度状态:0-停止,1-运行',
  31 + `trigger_last_time` bigint(13) NOT NULL DEFAULT '0' COMMENT '上次调度时间',
  32 + `trigger_next_time` bigint(13) NOT NULL DEFAULT '0' COMMENT '下次调度时间',
  33 + PRIMARY KEY (`id`)
  34 +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  35 +
  36 +CREATE TABLE `xxl_job_log` (
  37 + `id` bigint(20) NOT NULL AUTO_INCREMENT,
  38 + `job_group` int(11) NOT NULL COMMENT '执行器主键ID',
  39 + `job_id` int(11) NOT NULL COMMENT '任务,主键ID',
  40 + `executor_address` varchar(255) DEFAULT NULL COMMENT '执行器地址,本次执行的地址',
  41 + `executor_handler` varchar(255) DEFAULT NULL COMMENT '执行器任务handler',
  42 + `executor_param` varchar(512) DEFAULT NULL COMMENT '执行器任务参数',
  43 + `executor_sharding_param` varchar(20) DEFAULT NULL COMMENT '执行器任务分片参数,格式如 1/2',
  44 + `executor_fail_retry_count` int(11) NOT NULL DEFAULT '0' COMMENT '失败重试次数',
  45 + `trigger_time` datetime DEFAULT NULL COMMENT '调度-时间',
  46 + `trigger_code` int(11) NOT NULL COMMENT '调度-结果',
  47 + `trigger_msg` text COMMENT '调度-日志',
  48 + `handle_time` datetime DEFAULT NULL COMMENT '执行-时间',
  49 + `handle_code` int(11) NOT NULL COMMENT '执行-状态',
  50 + `handle_msg` text COMMENT '执行-日志',
  51 + `alarm_status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '告警状态:0-默认、1-无需告警、2-告警成功、3-告警失败',
  52 + PRIMARY KEY (`id`),
  53 + KEY `I_trigger_time` (`trigger_time`),
  54 + KEY `I_handle_code` (`handle_code`)
  55 +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  56 +
  57 +CREATE TABLE `xxl_job_log_report` (
  58 + `id` int(11) NOT NULL AUTO_INCREMENT,
  59 + `trigger_day` datetime DEFAULT NULL COMMENT '调度-时间',
  60 + `running_count` int(11) NOT NULL DEFAULT '0' COMMENT '运行中-日志数量',
  61 + `suc_count` int(11) NOT NULL DEFAULT '0' COMMENT '执行成功-日志数量',
  62 + `fail_count` int(11) NOT NULL DEFAULT '0' COMMENT '执行失败-日志数量',
  63 + PRIMARY KEY (`id`),
  64 + UNIQUE KEY `i_trigger_day` (`trigger_day`) USING BTREE
  65 +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  66 +
  67 +CREATE TABLE `xxl_job_logglue` (
  68 + `id` int(11) NOT NULL AUTO_INCREMENT,
  69 + `job_id` int(11) NOT NULL COMMENT '任务,主键ID',
  70 + `glue_type` varchar(50) DEFAULT NULL COMMENT 'GLUE类型',
  71 + `glue_source` mediumtext COMMENT 'GLUE源代码',
  72 + `glue_remark` varchar(128) NOT NULL COMMENT 'GLUE备注',
  73 + `add_time` datetime DEFAULT NULL,
  74 + `update_time` datetime DEFAULT NULL,
  75 + PRIMARY KEY (`id`)
  76 +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  77 +
  78 +CREATE TABLE `xxl_job_registry` (
  79 + `id` int(11) NOT NULL AUTO_INCREMENT,
  80 + `registry_group` varchar(50) NOT NULL,
  81 + `registry_key` varchar(255) NOT NULL,
  82 + `registry_value` varchar(255) NOT NULL,
  83 + `update_time` datetime DEFAULT NULL,
  84 + PRIMARY KEY (`id`),
  85 + KEY `i_g_k_v` (`registry_group`,`registry_key`,`registry_value`)
  86 +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  87 +
  88 +CREATE TABLE `xxl_job_group` (
  89 + `id` int(11) NOT NULL AUTO_INCREMENT,
  90 + `app_name` varchar(64) NOT NULL COMMENT '执行器AppName',
  91 + `title` varchar(12) NOT NULL COMMENT '执行器名称',
  92 + `address_type` tinyint(4) NOT NULL DEFAULT '0' COMMENT '执行器地址类型:0=自动注册、1=手动录入',
  93 + `address_list` varchar(512) DEFAULT NULL COMMENT '执行器地址列表,多地址逗号分隔',
  94 + PRIMARY KEY (`id`)
  95 +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  96 +
  97 +CREATE TABLE `xxl_job_user` (
  98 + `id` int(11) NOT NULL AUTO_INCREMENT,
  99 + `username` varchar(50) NOT NULL COMMENT '账号',
  100 + `password` varchar(50) NOT NULL COMMENT '密码',
  101 + `role` tinyint(4) NOT NULL COMMENT '角色:0-普通用户、1-管理员',
  102 + `permission` varchar(255) DEFAULT NULL COMMENT '权限:执行器ID列表,多个逗号分割',
  103 + PRIMARY KEY (`id`),
  104 + UNIQUE KEY `i_username` (`username`) USING BTREE
  105 +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  106 +
  107 +CREATE TABLE `xxl_job_lock` (
  108 + `lock_name` varchar(50) NOT NULL COMMENT '锁名称',
  109 + PRIMARY KEY (`lock_name`)
  110 +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  111 +
  112 +
  113 +INSERT INTO `xxl_job_group`(`id`, `app_name`, `title`, `address_type`, `address_list`) VALUES (1, 'xxl-job-executor-sample', '示例执行器', 0, NULL);
  114 +INSERT INTO `xxl_job_info`(`id`, `job_group`, `job_cron`, `job_desc`, `add_time`, `update_time`, `author`, `alarm_email`, `executor_route_strategy`, `executor_handler`, `executor_param`, `executor_block_strategy`, `executor_timeout`, `executor_fail_retry_count`, `glue_type`, `glue_source`, `glue_remark`, `glue_updatetime`, `child_jobid`) VALUES (1, 1, '0 0 0 * * ? *', '测试任务1', '2018-11-03 22:21:31', '2018-11-03 22:21:31', 'XXL', '', 'FIRST', 'demoJobHandler', '', 'SERIAL_EXECUTION', 0, 0, 'BEAN', '', 'GLUE代码初始化', '2018-11-03 22:21:31', '');
  115 +INSERT INTO `xxl_job_user`(`id`, `username`, `password`, `role`, `permission`) VALUES (1, 'admin', 'e10adc3949ba59abbe56e057f20f883e', 1, NULL);
  116 +INSERT INTO `xxl_job_lock` ( `lock_name`) VALUES ( 'schedule_lock');
  117 +
  118 +commit;
  119 +
... ...
jeecg-boot/jeecg-cloud-module/docker-compose.yml
... ... @@ -26,15 +26,6 @@ services:
26 26 restart: always
27 27 container_name: jeecg-boot-redis
28 28 hostname: jeecg-boot-redis
29   - jeecg-boot-rabbitmq:
30   - # image: rabbitmq:3-management
31   - image: rabbitmq:3
32   - ports:
33   - - 5672:5672
34   - # - 15672:15672
35   - restart: always
36   - container_name: jeecg-boot-rabbitmq
37   - hostname: jeecg-boot-rabbitmq
38 29  
39 30 jeecg-boot-nacos:
40 31 restart: always
... ... @@ -67,10 +58,20 @@ services:
67 58 environment:
68 59 - TZ=Asia/Shanghai
69 60  
70   - jeecg-boot-xxljob:
71   - build:
72   - context: ./jeecg-cloud-xxljob
73   - ports:
74   - - 9080:9080
75   - container_name: jeecg-boot-xxljob
76   - hostname: jeecg-boot-xxljob
77 61 \ No newline at end of file
  62 +# jeecg-boot-rabbitmq:
  63 +# # image: rabbitmq:3-management
  64 +# image: rabbitmq:3
  65 +# ports:
  66 +# - 5672:5672
  67 +# # - 15672:15672
  68 +# restart: always
  69 +# container_name: jeecg-boot-rabbitmq
  70 +# hostname: jeecg-boot-rabbitmq
  71 +
  72 +# jeecg-boot-xxljob:
  73 +# build:
  74 +# context: ./jeecg-cloud-xxljob
  75 +# ports:
  76 +# - 9080:9080
  77 +# container_name: jeecg-boot-xxljob
  78 +# hostname: jeecg-boot-xxljob
78 79 \ No newline at end of file
... ...
jeecg-boot/jeecg-cloud-module/jeecg-cloud-system-start/Dockerfile
... ... @@ -12,5 +12,4 @@ EXPOSE 7001
12 12  
13 13 ADD ./target/jeecg-cloud-system-start-2.4.2.jar ./
14 14  
15   -CMD java -Dfile.encoding=utf-8 -Djava.security.egd=file:/dev/./urandom -jar jeecg-cloud-system-start-2.4.2.jar
16   -
  15 +CMD sleep 60;java -Dfile.encoding=utf-8 -Djava.security.egd=file:/dev/./urandom -jar jeecg-cloud-system-start-2.4.2.jar
17 16 \ No newline at end of file
... ...