增加docker运行方式,快速跑起来。

newFeature
Mahone 2 years ago
parent ab9a21b0c3
commit bfdfe44403

@ -0,0 +1,70 @@
**支持Linux和Windows下运行
**Docker环境请自行准备
- # 构建后台
1. yml配置文件请确保每一项下面按正确配置
```
server:
port: 8080
servlet:
context-path: /ky
base:
#上传文件保存的路径
upload-dir: /kykms/KmDocs
# libreOffice安装路径
soffice-path: /usr/bin/soffice
esclient:
master-host: kykms-ES
master-port: 9200
spring:
datasource:
dynamic:
datasource:
# 数据库登录信息配置
master:
url: jdbc:mysql://kykms-mysql:3306/km?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
username: root
password: root
#redis 配置
redis:
database: 0
host: kykms-redis
password: ''
port: 6379
```
2. 通过jeecg-boot-parent项目 maven打包执行install
3. 打包Docker容器
```
进入jeecg-boot根路径下面命令、启动镜像容器组
docker-compose up -d
```
4. 访问后台项目注意要开启swaggerhttp://localhost:8080/jeecg-boot/doc.html
- # 构建前端
1. 修改前端项目的后台域名
.env.production
```
VUE_APP_API_BASE_URL=http://localhost:8080/ky
```
2. 进入ant-design-vue-jeecg根目录
```
yarn run build
```
3. 构建镜像(注意后面的".“)
```
docker build -t nginx:kykms .
```
4. 启动镜像
```
docker run --name kykms-nginx -p 80:80 -d nginx:kykms
```
5. 访问前台项目 http://localhost:80

@ -15,7 +15,6 @@ tar zxvf elasticsearch-7.6.1-linux-x86_64.tar.gz
## 配置ES ## 配置ES
cd /usr/local/elasticsearch-7.6.1/config cd /usr/local/elasticsearch-7.6.1/config
vi elasticsearch.yml 增加配置: vi elasticsearch.yml 增加配置:
xpack.security.enabled: true
discovery.type: single-node discovery.type: single-node
network.host: 0.0.0.0 network.host: 0.0.0.0
indices.query.bool.max_clause_count: 102400 indices.query.bool.max_clause_count: 102400
@ -35,11 +34,8 @@ cd /usr/local/elasticsearch-7.6.1/bin
## 启动es ## 启动es
cd /usr/local/elasticsearch-7.6.1/bin cd /usr/local/elasticsearch-7.6.1/bin
su elasticsearch su elasticsearch
./elasticsearch -d ./elasticsearch -d
## 创建elastic 的Elastic用户
./elasticsearch-setup-passwords auto
拷贝用户elastic的密码配置到application.yml文件
- # **Windows环境安装** - # **Windows环境安装**
@ -49,8 +45,7 @@ cd /usr/local/elasticsearch-7.6.1/bin
## 配置ES ## 配置ES
cd C:\software\elasticsearch-7.6.1\config cd C:\software\elasticsearch-7.6.1\config
### 编辑 elasticsearch.yml 增加配置: ### 编辑 elasticsearch.yml 增加配置:
xpack.security.enabled: true
discovery.type: single-node discovery.type: single-node
network.host: 0.0.0.0 network.host: 0.0.0.0
indices.query.bool.max_clause_count: 102400 indices.query.bool.max_clause_count: 102400
@ -66,7 +61,4 @@ cd /usr/local/elasticsearch-7.6.1/bin
## 启动es ## 启动es
cd C:\software\elasticsearch-7.6.1\config\bin cd C:\software\elasticsearch-7.6.1\config\bin
执行 elasticsearch.bat 执行 elasticsearch.bat
## 创建elastic 的Elastic用户
执行 elasticsearch-setup-passwords.bat auto
拷贝用户elastic的密码配置到application.yml文件

@ -1,4 +1,4 @@
NODE_ENV=development NODE_ENV=development
VUE_APP_API_BASE_URL=http://localhost:9090/ky VUE_APP_API_BASE_URL=http://localhost:8080/ky
VUE_APP_CAS_BASE_URL=http://cas.example.org:8443/cas VUE_APP_CAS_BASE_URL=http://cas.example.org:8443/cas
VUE_APP_ONLINE_BASE_URL=http://localhost/onlinePreview VUE_APP_ONLINE_BASE_URL=http://localhost/onlinePreview

@ -1,4 +1,4 @@
NODE_ENV=production NODE_ENV=production
VUE_APP_API_BASE_URL=http://172.16.2.47:8080/ky VUE_APP_API_BASE_URL=http://localhost:8080/ky
VUE_APP_CAS_BASE_URL=http://localhost:8888/cas VUE_APP_CAS_BASE_URL=http://localhost:8888/cas
VUE_APP_ONLINE_BASE_URL=http://localhost/onlinePreview VUE_APP_ONLINE_BASE_URL=http://localhost/onlinePreview

@ -1,4 +1,4 @@
NODE_ENV=test NODE_ENV=test
VUE_APP_API_BASE_URL=http://119.29.145.199:8080/ky VUE_APP_API_BASE_URL=http://localhost:8080/ky
VUE_APP_CAS_BASE_URL=http://cas.example.org:8443/cas VUE_APP_CAS_BASE_URL=http://cas.example.org:8443/cas
VUE_APP_ONLINE_BASE_URL=http://localhost/onlinePreview VUE_APP_ONLINE_BASE_URL=http://localhost/onlinePreview

@ -1,12 +1,12 @@
FROM nginx FROM nginx
MAINTAINER jeecgos@163.com MAINTAINER hnliuwx@gmail.com
VOLUME /tmp VOLUME /tmp
ENV LANG en_US.UTF-8 ENV LANG en_US.UTF-8
RUN echo "server { \ RUN echo "server { \
listen 80; \ listen 81; \
location ^~ /jeecg-boot { \ location ^~ /ky { \
proxy_pass http://jeecg-boot-system:8080/jeecg-boot/; \ proxy_pass http://localhost:8080/ky/; \
proxy_set_header Host jeecg-boot-system; \ proxy_set_header Host localhost; \
proxy_set_header X-Real-IP \$remote_addr; \ proxy_set_header X-Real-IP \$remote_addr; \
proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for; \ proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for; \
} \ } \

@ -76,7 +76,7 @@ module.exports = {
}, },
devServer: { devServer: {
port: 3000, port: 80,
proxy: { proxy: {
/* '/api': { /* '/api': {
target: 'https://mock.ihx.me/mock/5baf3052f7da7e07e04a5116/antd-pro', //mock API接口系统 target: 'https://mock.ihx.me/mock/5baf3052f7da7e07e04a5116/antd-pro', //mock API接口系统

@ -0,0 +1,9 @@
FROM mysql:5.7
MAINTAINER hnliuwx@gmail.com
ENV TZ=Asia/Shanghai
RUN ln -sf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
COPY ./km_mysql.sql /docker-entrypoint-initdb.d

@ -0,0 +1,62 @@
## 商业版试用镜像提供源下载,仅限于个人学习用途,如擅自用于商业用途,带来的一切后果由个人负责
## !!!!暂未完善,如有需求请联系作者!!!!!
##执行启动命令 docker-compose -f ./docker-compose-business.yml up
version: '2'
services:
kykms-mysql:
image: mahonelau/kykms-mysql:business
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_ROOT_HOST: '%'
TZ: Asia/Shanghai
restart: always
container_name: kykms-mysql
command:
--character-set-server=utf8mb4
--collation-server=utf8mb4_general_ci
--explicit_defaults_for_timestamp=true
--lower_case_table_names=1
--max_allowed_packet=128M
ports:
- 3306:3306
kykms-redis:
image: redis:5.0
ports:
- 6379:6379
restart: always
container_name: kykms-redis
kykms-ES:
image: mahonelau/kykms-es:business
restart: always
hostname: kykms-ES
container_name: kykms-ES
ports:
- 9200:9200
- 9300:9300
environment:
discovery.type: single-node
ES_JAVA_OPTS: "-Xms512m -Xmx512m"
cpuset-cpus: 1
m: 2G
kykms:
image: mahonelau/kykms:business
restart: always
container_name: kykms
volumes:
- /data/config:/kykms/config
ports:
- 8080:8080
kykms-nginx:
image: mahonelau/kykms-nginx:business
restart: always
- kykms-mysql
- kykms-redis
- kykms
- kykms-ES
container_name: kykms-nginx
ports:
- 80:80

@ -0,0 +1,63 @@
#### 镜像上传
# 仓库私服: 81.70.17.111:5000
# 第一步上传前端镜像到docker仓库
#docker tag kykms-nginx 81.70.17.111:5000/kykms-nginx:1.0
#docker push 81.70.17.111:5000/kykms-nginx:1.0
# 第二步将此yml文件上传服务器执行启动命令 docker-compose -f ./docker-compose-official.yml up
version: '2'
services:
kykms-mysql:
image: mahonelau/kykms-mysql:latest
environment:
MYSQL_ROOT_PASSWORD: root
restart: always
container_name: kykms-mysql
command:
--character-set-server=utf8mb4
--collation-server=utf8mb4_general_ci
--explicit_defaults_for_timestamp=true
--lower_case_table_names=1
--max_allowed_packet=128M
ports:
- 3306:3306
kykms-redis:
image: redis:5.0
ports:
- 6379:6379
restart: always
container_name: kykms-redis
kykms-ES:
build:
context: ./ES
image: mahonelau/kykms-es:latest
restart: always
hostname: kykms-ES
container_name: kykms-ES
ports:
- 9200:9200
- 9300:9300
environment:
discovery.type: single-node
ES_JAVA_OPTS: "-Xms512m -Xmx512m"
cpuset-cpus: 1
m: 2G
kykms:
image: mahonelau/kykms:latest
restart: always
container_name: kykms
volumes:
- /data/config:/kykms/config
ports:
- 8080:8080
kykms-nginx:
image: 81.70.17.111:5000/kykms-nginx:1.0
restart: always
container_name: kykms-nginx
ports:
- 80:80

@ -1,23 +1,25 @@
#### 镜像上传 #### 镜像上传
# 仓库私服: 81.70.17.111:5000 # 仓库私服: 81.70.17.111:5000
# 第一步上传镜像到docker仓库 # 第一步上传镜像到docker仓库
#docker tag jeecg-boot-mysql 81.70.17.111:5000/jeecg-boot-mysql:1.1 #docker tag kykms-mysql 81.70.17.111:5000/kykms-mysql:1.0
#docker tag jeecg-boot-system 81.70.17.111:5000/jeecg-boot-system:1.0 #docker tag kykms 81.70.17.111:5000/kykms:1.0
#docker tag nginxhtml:jeecgboot 81.70.17.111:5000/nginxhtml:1.2 #docker tag kykms-nginx 81.70.17.111:5000/kykms-nginx:1.0
#docker tag kykms-es 81.70.17.111:5000/kykms-es:1.0
#docker push 81.70.17.111:5000/jeecg-boot-mysql:1.1 #docker push 81.70.17.111:5000/kykms-mysql:1.0
#docker push 81.70.17.111:5000/jeecg-boot-system:1.0 #docker push 81.70.17.111:5000/kykms:1.0
#docker push 81.70.17.111:5000/nginxhtml:1.2 #docker push 81.70.17.111:5000/kykms-nginx:1.0
#docker push 81.70.17.111:5000/kykms-es:1.0
# 第二步将此yml文件上传服务器执行启动命令 docker-compose -f ./docker-compose-server.yml up # 第二步将此yml文件上传服务器执行启动命令 docker-compose -f ./docker-compose-server.yml up
version: '2' version: '2'
services: services:
jeecg-boot-mysql: kykms-mysql:
image: 81.70.17.111:5000/jeecg-boot-mysql:1.0 image: 81.70.17.111:5000/kykms-mysql:1.0
environment: environment:
MYSQL_ROOT_PASSWORD: root MYSQL_ROOT_PASSWORD: root
restart: always restart: always
container_name: jeecg-boot-mysql container_name: kykms-mysql
command: command:
--character-set-server=utf8mb4 --character-set-server=utf8mb4
--collation-server=utf8mb4_general_ci --collation-server=utf8mb4_general_ci
@ -25,27 +27,41 @@ services:
--lower_case_table_names=1 --lower_case_table_names=1
--max_allowed_packet=128M --max_allowed_packet=128M
ports: ports:
- 3306:3306 - 3306:3306
jeecg-boot-redis: kykms-redis:
image: redis:5.0 image: redis:5.0
ports: ports:
- 6379:6379 - 6379:6379
restart: always restart: always
container_name: jeecg-boot-redis container_name: kykms-redis
jeecg-boot-system: kykms-ES:
image: 81.70.17.111:5000/jeecg-boot-system:1.0 image: 81.70.17.111:5000/kykms-es:1.0
restart: always restart: always
container_name: jeecg-boot-system hostname: kykms-ES
container_name: kykms-ES
ports:
- 9200:9200
- 9300:9300
environment:
discovery.type: single-node
ES_JAVA_OPTS: "-Xms512m -Xmx512m"
cpuset-cpus: 1
m: 2G
kykms:
image: 81.70.17.111:5000/kykms:1.0
restart: always
container_name: kykms
volumes: volumes:
- /data/config:/jeecg-boot/config - /data/config:/kykms/config
ports: ports:
- 8080:8080 - 8080:8080
jeecg-boot-nginx: kykms-nginx:
image: 81.70.17.111:5000/nginxhtml image: 81.70.17.111:5000/kykms-nginx:1.0
restart: always restart: always
container_name: jeecg-boot-nginx container_name: kykms-nginx
ports: ports:
- 80:80 - 80:80

@ -1,6 +1,6 @@
version: '2' version: '2'
services: services:
jeecg-boot-mysql: kykms-mysql:
build: build:
context: ./db context: ./db
environment: environment:
@ -8,35 +8,53 @@ services:
MYSQL_ROOT_HOST: '%' MYSQL_ROOT_HOST: '%'
TZ: Asia/Shanghai TZ: Asia/Shanghai
restart: always restart: always
container_name: jeecg-boot-mysql container_name: kykms-mysql
image: jeecg-boot-mysql image: mysql:5.7
command: command:
--character-set-server=utf8mb4 --character-set-server=utf8mb4
--collation-server=utf8mb4_general_ci --collation-server=utf8mb4_general_ci
--explicit_defaults_for_timestamp=true --explicit_defaults_for_timestamp=true
--lower_case_table_names=1 --lower_case_table_names=1
--max_allowed_packet=128M --max_allowed_packet=128M
--default-authentication-plugin=caching_sha2_password # --default-authentication-plugin=caching_sha2_password
ports: ports:
- 3306:3306 - 3306:3306
jeecg-boot-redis: kykms-redis:
image: redis:5.0 image: redis:5.0
ports: ports:
- 6379:6379 - 6379:6379
restart: always restart: always
hostname: jeecg-boot-redis hostname: kykms-redis
container_name: jeecg-boot-redis container_name: kykms-redis
jeecg-boot-system: kykms-ES:
build:
context: ./ES
image: elasticsearch:7.6.1
restart: always
hostname: kykms-ES
container_name: kykms-ES
ports:
- 9200:9200
- 9300:9300
environment:
discovery.type: single-node
ES_JAVA_OPTS: "-Xms512m -Xmx512m"
cpuset-cpus: 1
m: 2G
kykms:
build: build:
context: ./jeecg-boot-module-system context: ./jeecg-boot-module-system
restart: on-failure restart: on-failure
privileged: true
depends_on: depends_on:
- jeecg-boot-mysql - kykms-mysql
- jeecg-boot-redis - kykms-redis
container_name: jeecg-boot-system - kykms-ES
image: jeecg-boot-system container_name: kykms
hostname: jeecg-boot-system image: kykms
hostname: kykms
ports: ports:
- 8080:8080 - 8080:8080

@ -1,18 +1,18 @@
//package org.jeecg.config; package org.jeecg.config;
//
//import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
//import org.springframework.web.socket.server.standard.ServerEndpointExporter; import org.springframework.web.socket.server.standard.ServerEndpointExporter;
//
//@Configuration @Configuration
//public class WebSocketConfig { public class WebSocketConfig {
// /** /**
// * 注入ServerEndpointExporter * ServerEndpointExporter
// * 这个bean会自动注册使用了@ServerEndpoint注解声明的Websocket endpoint * bean使@ServerEndpointWebsocket endpoint
// */ */
// @Bean @Bean
// public ServerEndpointExporter serverEndpointExporter() { public ServerEndpointExporter serverEndpointExporter() {
// return new ServerEndpointExporter(); return new ServerEndpointExporter();
// } }
//
//} }

@ -63,9 +63,9 @@ public class ElasticsearchConfig {
HttpHost host=new HttpHost(masterHost, masterPort, HttpHost.DEFAULT_SCHEME_NAME); HttpHost host=new HttpHost(masterHost, masterPort, HttpHost.DEFAULT_SCHEME_NAME);
RestClientBuilder builder=RestClient.builder(host); RestClientBuilder builder=RestClient.builder(host);
CredentialsProvider credentialsProvider = new BasicCredentialsProvider(); // CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
credentialsProvider.setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(masterUserName, masterUserPwd)); // credentialsProvider.setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(masterUserName, masterUserPwd));
builder.setHttpClientConfigCallback(f -> f.setDefaultCredentialsProvider(credentialsProvider)); // builder.setHttpClientConfigCallback(f -> f.setDefaultCredentialsProvider(credentialsProvider));
RestHighLevelClient restClient = new RestHighLevelClient( builder); RestHighLevelClient restClient = new RestHighLevelClient( builder);
return restClient; return restClient;

@ -1,15 +1,25 @@
FROM anapsix/alpine-java:8_server-jre_unlimited FROM ansible/centos7-ansible
MAINTAINER jeecgos@163.com ENV container docker
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime; \
cd /etc/yum.repos.d;\
curl -o /etc/yum.repos.d/Centos-7.repo http://mirrors.aliyun.com/repo/Centos-7.repo;\
curl -o /etc/yum.repos.d/epel-7.repo http://mirrors.aliyun.com/repo/epel-7.repo;\
curl -o /etc/yum.repos.d/CentOS7-Base-163.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo;\
yum clean all;\
yum makecache;\
yum install libreoffice-writer.x86_64 -y; \
RUN mkdir -p /jeecg-boot mkdir /kykms
WORKDIR /jeecg-boot WORKDIR /kykms
EXPOSE 8080 EXPOSE 8080
ADD ./target/jeecg-boot-module-system-2.4.5.jar ./ ADD ./target/jeecg-boot-module-system-2.4.5.jar ./
ADD ./simsun.ttc /usr/share/fonts
CMD sleep 60;java -Djava.security.egd=file:/dev/./urandom -jar jeecg-boot-module-system-2.4.5.jar CMD /usr/sbin/init;\
sleep 10;\
java -Djava.security.egd=file:/dev/./urandom -jar jeecg-boot-module-system-2.4.5.jar

@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>jeecg-boot-module-system</artifactId> <artifactId>jeecg-boot-module-system</artifactId>
<packaging>war</packaging> <packaging>jar</packaging>
<repositories> <repositories>
<repository> <repository>
@ -59,16 +59,16 @@
<!--</dependency>--> <!--</dependency>-->
</dependencies> </dependencies>
<!--<build>--> <build>
<!--<plugins>--> <plugins>
<!--<plugin>--> <plugin>
<!--<groupId>org.springframework.boot</groupId>--> <groupId>org.springframework.boot</groupId>
<!--<artifactId>spring-boot-maven-plugin</artifactId>--> <artifactId>spring-boot-maven-plugin</artifactId>
<!--<configuration>--> <configuration>
<!--&lt;!&ndash;微服务模式下修改为true,跳过此打包插件,否则微服务模块无法引用&ndash;&gt;--> <!--微服务模式下修改为true,跳过此打包插件,否则微服务模块无法引用-->
<!--<skip>false</skip>--> <skip>false</skip>
<!--</configuration>--> </configuration>
<!--</plugin>--> </plugin>
<!--</plugins>--> </plugins>
<!--</build>--> </build>
</project> </project>

@ -1,5 +1,5 @@
server: server:
port: 9090 port: 8080
tomcat: tomcat:
max-swallow-size: -1 max-swallow-size: -1
error: error:

@ -22,17 +22,16 @@ management:
##文件上传和转换工具的配置 ##文件上传和转换工具的配置
base: base:
#上传文件保存的路径 #上传文件保存的路径
upload-dir: /opt/KmDocs upload-dir: /kykms/KmDocs
# libreOffice安装路径 # libreOffice安装路径
soffice-path: /opt/libreoffice7.0/program/soffice soffice-path: /usr/bin/soffice
# soffice-path: /opt/libreoffice7.0/program/soffice
one-system-url: one-system-url:
##ElasticSearch服务配置 for highLevelRestClient ##ElasticSearch服务配置 for highLevelRestClient
esclient: esclient:
master-host: 127.0.0.1 master-host: kykms-ES
master-port: 9200 master-port: 9200
master-user-name: elastic
master-user-pwd: xxxxxxxx
spring: spring:
servlet: servlet:
@ -97,14 +96,14 @@ spring:
datasource: datasource:
# 数据库登录信息配置 # 数据库登录信息配置
master: master:
url: jdbc:mysql://127.0.0.1:3306/km?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai url: jdbc:mysql://kykms-mysql:3306/km?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
username: root username: root
password: xxxxxxxx password: root
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
#redis 配置 #redis 配置
redis: redis:
database: 0 database: 0
host: 127.0.0.1 host: kykms-redis
lettuce: lettuce:
pool: pool:
max-active: 8 max-active: 8

@ -21,27 +21,26 @@ management:
##文件上传和转换工具的配置 ##文件上传和转换工具的配置
base: base:
# upload-dir: /opt/KmDocs #上传文件保存的路径
# soffice-path: /opt/libreoffice7.0/program/soffice upload-dir: /kykms/KmDocs
upload-dir: c:\KmDocs # libreOffice安装路径
soffice-path: C:\Program Files\LibreOffice\program\soffice.exe soffice-path: /usr/bin/soffice
# soffice-path: /opt/libreoffice7.0/program/soffice
one-system-url: one-system-url:
##ElasticSearch服务配置 for highLevelRestClient ##ElasticSearch服务配置 for highLevelRestClient
esclient: esclient:
master-host: 127.0.0.1 master-host: kykms-ES
master-port: 9200 master-port: 9200
master-user-name: elastic
master-user-pwd: xxxxxxxx
spring: spring:
servlet: servlet:
multipart: multipart:
max-file-size: 2MB max-file-size: 2000MB
max-request-size: 20MB max-request-size: 2000MB
mail: mail:
host: smtp.163.com host:
username: jeecgos@163.com username:
password: ?? password: ??
properties: properties:
mail: mail:
@ -50,27 +49,19 @@ spring:
starttls: starttls:
enable: true enable: true
required: true required: true
#json 时间戳统一转换
jackson: jackson:
date-format: yyyy-MM-dd HH:mm:ss date-format: yyyy-MM-dd HH:mm:ss
time-zone: GMT+8 time-zone: GMT+8
aop: aop:
proxy-target-class: true proxy-target-class: true
#配置freemarker
freemarker: freemarker:
# 设置模板后缀名
suffix: .ftl suffix: .ftl
# 设置文档类型
content-type: text/html content-type: text/html
# 设置页面编码格式
charset: UTF-8 charset: UTF-8
# 设置页面缓存
cache: false cache: false
prefer-file-system-access: false prefer-file-system-access: false
# 设置ftl文件路径
template-loader-path: template-loader-path:
- classpath:/templates - classpath:/templates
# 设置静态文件路径js,css等
mvc: mvc:
static-path-pattern: /** static-path-pattern: /**
resource: resource:
@ -87,93 +78,72 @@ spring:
web-stat-filter: web-stat-filter:
enabled: true enabled: true
dynamic: dynamic:
druid: # 全局druid参数绝大部分值和默认保持一致。(现已支持的参数如下,不清楚含义不要乱设置) druid:
# 连接池的配置信息
# 初始化大小,最小,最大
initial-size: 5 initial-size: 5
min-idle: 5 min-idle: 5
maxActive: 1000 maxActive: 1000
# 配置获取连接等待超时的时间
maxWait: 60000 maxWait: 60000
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
timeBetweenEvictionRunsMillis: 60000 timeBetweenEvictionRunsMillis: 60000
# 配置一个连接在池中最小生存的时间,单位是毫秒
minEvictableIdleTimeMillis: 300000 minEvictableIdleTimeMillis: 300000
validationQuery: SELECT 1 FROM DUAL validationQuery: SELECT 1 FROM DUAL
testWhileIdle: true testWhileIdle: true
testOnBorrow: false testOnBorrow: false
testOnReturn: false testOnReturn: false
# 打开PSCache并且指定每个连接上PSCache的大小,mysql建议关闭
poolPreparedStatements: false poolPreparedStatements: false
maxPoolPreparedStatementPerConnectionSize: -1 maxPoolPreparedStatementPerConnectionSize: -1
# 配置监控统计拦截的filters去掉后监控界面sql无法统计'wall'用于防火墙
filters: stat,wall,slf4j filters: stat,wall,slf4j
# 通过connectProperties属性来打开mergeSql功能慢SQL记录
connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000 connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
datasource: datasource:
# 数据库登录信息配置
master: master:
url: jdbc:mysql://127.0.0.1:3306/km?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai url: jdbc:mysql://kykms-mysql:3306/km?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
username: root username: root
password: xxxxxxxx password: root
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
#redis 配置 #redis 配置
redis: redis:
database: 0 database: 0
host: 127.0.0.1 host: kykms-redis
lettuce: lettuce:
pool: pool:
max-active: 8 #最大连接数据库连接数,设 -1 为没有限制 max-active: 8
max-idle: 8 #最大等待连接中的数量,设 0 为没有限制 max-idle: 8
max-wait: -1ms #最大建立连接等待时间。如果超过此时间将接到异常。设为-1表示无限制。 max-wait: -1ms
min-idle: 0 #最小等待连接中的数量,设 0 为没有限制 min-idle: 0
shutdown-timeout: 100ms shutdown-timeout: 100ms
password: '' password: ''
port: 6379 port: 6379
#mybatis plus 设置
mybatis-plus: mybatis-plus:
mapper-locations: classpath*:org/jeecg/modules/**/xml/*Mapper.xml mapper-locations: classpath*:org/jeecg/modules/**/xml/*Mapper.xml
global-config: global-config:
# 关闭MP3.0自带的banner
banner: false banner: false
db-config: db-config:
#主键类型 0:"数据库ID自增",1:"该类型为未设置主键类型", 2:"用户输入ID",3:"全局唯一ID (数字类型唯一ID)", 4:"全局唯一ID UUID",5:"字符串全局唯一ID (idWorker 的字符串表示)";
id-type: ASSIGN_ID id-type: ASSIGN_ID
# 默认数据库表下划线命名
table-underline: true table-underline: true
configuration: configuration:
# 这个配置会将执行的sql打印出来在开发或测试的时候可以用 #log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
# 返回类型为Map,显示null对应的字段
call-setters-on-nulls: true call-setters-on-nulls: true
#jeecg专用配置
minidao :
base-package: org.jeecg.modules.jmreport.*
#DB类型mysql | postgresql | oracle | sqlserver| other
db-type: mysql
jeecg : jeecg :
# 本地local\Miniominio\阿里云alioss
uploadType: alioss uploadType: alioss
path : path :
#文件上传根目录 设置 upload: /opt/upload
upload: /opt/jeecg-boot/upload webapp: /opt/webapp
#webapp文件路径
webapp: /opt/jeecg-boot/webapp
shiro: shiro:
excludeUrls: /test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/category/**,/visual/**,/map/**,/jmreport/bigscreen2/**,/sys/loginThird,/KM/EsMgnt/** excludeUrls: /test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/category/**,/visual/**,/map/**,/jmreport/bigscreen2/**,/sys/loginThird,/KM/EsMgnt/**
#阿里云oss存储和大鱼短信秘钥配置
oss: oss:
accessKey: ?? accessKey: ??
secretKey: ?? secretKey: ??
endpoint: oss-cn-beijing.aliyuncs.com endpoint: oss-cn-beijing.aliyuncs.com
bucketName: ?? bucketName: ??
staticDomain: https://static.jeecg.com staticDomain: https://static.jeecg.com
# minio文件上传
minio: minio:
minio_url: http://minio.jeecg.com minio_url: http://minio.jeecg.com
minio_name: ?? minio_name: ??
minio_pass: ?? minio_pass: ??
bucketName: ?? bucketName: ??
#xxl-job配置
xxljob: xxljob:
enabled: false enabled: false
adminAddresses: http://127.0.0.1:9080/xxl-job-admin adminAddresses: http://127.0.0.1:9080/xxl-job-admin
@ -184,29 +154,24 @@ jeecg :
port: 30007 port: 30007
logPath: logs/jeecg/job/jobhandler/ logPath: logs/jeecg/job/jobhandler/
logRetentionDays: 30 logRetentionDays: 30
#自定义路由配置 yml nacos database
route: route:
config: config:
data-id: jeecg-gateway-router data-id: jeecg-gateway-router
group: DEFAULT_GROUP group: DEFAULT_GROUP
data-type: yml data-type: yml
#分布式锁配置
redisson: redisson:
address: 127.0.0.1:6379 address: 127.0.0.1:6379
password: password:
type: STANDALONE type: STANDALONE
enabled: true enabled: true
#cas单点登录
cas: cas:
prefixUrl: http://cas.example.org:8443/cas prefixUrl: http://cas.example.org:8443/cas
#Mybatis输出sql日志
logging: logging:
level: level:
org.jeecg.modules.system.mapper : info org.jeecg.modules.system.mapper : info
#swagger
knife4j: knife4j:
production: false production: false
basic: basic:
enable: true enable: true
username: jeecg username: jeecg
password: jeecg1314 password: jeecg1314

@ -6,8 +6,10 @@
> 3. 安装Mysql5.7,启动 > 3. 安装Mysql5.7,启动
> 4. 安装Elasticsearch具体可参考ES安装.md > 4. 安装Elasticsearch具体可参考ES安装.md
> 5. 安装LibreOffice > 5. 安装LibreOffice
> [linux下载链接](https://download.documentfoundation.org/libreoffice/stable/7.2.6/rpm/x86_64/LibreOffice_7.2.6_Linux_x86-64_rpm.tar.gz) > [linux下载链接](https://download.documentfoundation.org/libreoffice/stable/7.2.7/rpm/x86_64/LibreOffice_7.2.7_Linux_x86-64_rpm.tar.gz)
> [win下载链接](http://download.documentfoundation.org/libreoffice/stable/7.2.6/win/x86_64/LibreOffice_7.2.6_Win_x64.msi) > [win下载链接](http://download.documentfoundation.org/libreoffice/stable/7.2.7/win/x86_64/LibreOffice_7.2.7_Win_x64.msi)
# Docker快速运行
用IDE将代码编译环境与Maven环境搭建好在Docker环境下可以快速启动具体参见 Docker方式快速运行.MD
# 项目启动与运行 # 项目启动与运行
@ -76,4 +78,4 @@ VUE_APP_API_BASE_URL=http://localhost:8080/km
5. 点击serve 启动项目,看到如下日志 则启动成功 5. 点击serve 启动项目,看到如下日志 则启动成功
![KY KMS](./Docs/Pics/web_success.png) ![KY KMS](./Docs/Pics/web_success.png)
6. 通过 http://localhost:3000 访问前端项目,默认账号密码: admin/123456 6. 通过 http://localhost 访问前端项目,默认账号密码: admin/123456
Loading…
Cancel
Save