Compare commits

..

4 Commits

Author SHA1 Message Date
DongZeLiang 9d1382762a 移除,代码控制台打印启动成功 2024-04-24 15:39:03 +08:00
DongZeLiang 6eed0e51f3 设置字符集utf-8 2024-04-24 15:23:01 +08:00
DongZeLiang 0d91b28b7f 设置字符集utf-8 2024-04-24 15:21:23 +08:00
DongZeLiang 932df1698b dockerfile打包 2024-04-24 15:06:18 +08:00
10 changed files with 114 additions and 148 deletions

19
Dockerfile 100644
View File

@ -0,0 +1,19 @@
FROM anolis-registry.cn-zhangjiakou.cr.aliyuncs.com/openanolis/openjdk:17-8.6
LABEL authors="muyu"
#定义时区参数
ENV TZ=Asia/Shanghai
#设置时区
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo '$TZ' > /etc/timezone
# 定义工作目录
RUN mkdir -p /home/app
# 定义镜像落脚点
WORKDIR /home/app
# 拷贝jar包
COPY ./ruoyi-application/target/ruoyi-application.jar /home/app/app.jar
# 执行
CMD ["java", "-Dfile.encoding=utf-8", "-jar", "/home/app/app.jar", "--spring.profiles.active=test"]

View File

@ -1,3 +0,0 @@
https://github.com/alibaba/nacos/releases
在这个页面下载最新版的nacos
我的项目名称是muyu所以我创建了两个配置文件muyu-dev.yml和muyu-test.yml

View File

@ -1,97 +0,0 @@
# 项目相关配置
ruoyi:
# 名称
name: RuoYi
# 版本
version: 3.8.6
# 版权年份
copyrightYear: 2023
# 实例演示开关
demoEnabled: true
# 文件路径 示例( Windows配置D:/ruoyi/uploadPathLinux配置 /home/ruoyi/uploadPath
profile: D:/ruoyi/uploadPath
# 获取ip地址开关
addressEnabled: false
# 验证码类型 math 数字计算 char 字符验证
captchaType: math
# 开发环境配置
server:
# 服务器的HTTP端口默认为8080
port: 8080
servlet:
# 应用的访问路径
context-path: /
tomcat:
# tomcat的URI编码
uri-encoding: UTF-8
# 连接数满后的排队数默认为100
accept-count: 1000
threads:
# tomcat最大线程数默认为200
max: 800
# Tomcat启动初始化的线程数默认值10
min-spare: 100
# 日志配置
logging:
level:
com.ruoyi: debug
org.springframework: warn
# 用户配置
user:
password:
# 密码最大错误次数
maxRetryCount: 5
# 密码锁定时间默认10分钟
lockTime: 10
# Spring配置
spring:
# 资源信息
messages:
# 国际化资源文件路径
basename: i18n/messages
profiles:
active: dev
# 文件上传
servlet:
multipart:
# 单个文件大小
max-file-size: 10MB
# 设置总上传的文件大小
max-request-size: 20MB
# token配置
token:
# 令牌自定义标识
header: Authorization
# 令牌密钥
secret: abcdefghijklmnopqrstuvwxyz
# 令牌有效期默认30分钟
expireTime: 30
# MyBatis配置
mybatis:
# 配置mapper的扫描找到所有的mapper.xml映射文件
mapperLocations: classpath*:mapper/**/*Mapper.xml
# 加载全局的配置文件
configLocation: classpath:mybatis/mybatis-config.xml
# PageHelper分页插件
pagehelper:
helperDialect: mysql
supportMethodsArguments: true
params: count=countSql
# 防止XSS攻击
xss:
# 过滤开关
enabled: true
# 排除链接(多个用逗号分隔)
excludes: /system/notice
# 匹配链接
urlPatterns: /system/*,/monitor/*,/tool/*

View File

@ -31,7 +31,6 @@
<velocity.version>2.3</velocity.version>
<jwt.version>0.9.1</jwt.version>
<knife4j.version>4.3.0</knife4j.version>
<nacos.config.version>0.2.12</nacos.config.version>
</properties>
<!-- 依赖声明 -->
@ -47,13 +46,6 @@
<scope>import</scope>
</dependency>
<!-- nacos配置中心 -->
<dependency>
<groupId>com.alibaba.boot</groupId>
<artifactId>nacos-config-spring-boot-starter</artifactId>
<version>${nacos.config.version}</version>
</dependency>
<!-- knife4j 依赖 -->
<dependency>
<groupId>com.github.xiaoymin</groupId>

View File

@ -80,12 +80,6 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
</dependency>
<!-- nacos配置中心 -->
<dependency>
<groupId>com.alibaba.boot</groupId>
<artifactId>nacos-config-spring-boot-starter</artifactId>
</dependency>
</dependencies>
<build>

View File

@ -14,6 +14,5 @@ import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
public class RuoYiApplication {
public static void main (String[] args) {
SpringApplication.run(RuoYiApplication.class, args);
System.out.println("(♥◠‿◠)ノ゙ 若依启动成功 ლ(´ڡ`ლ)゙");
}
}

View File

@ -35,7 +35,7 @@ spring:
druid:
# 主库数据源
master:
url: jdbc:mysql://localhost:3306/vue-server?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
url: jdbc:mysql://localhost:3306/etl-server?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: root
# 从库数据源

View File

@ -10,7 +10,7 @@ spring:
# redis 配置
redis:
# 地址
host: localhost
host: redis
# 端口默认为6379
port: 6379
# 数据库索引
@ -35,9 +35,9 @@ spring:
druid:
# 主库数据源
master:
url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
url: jdbc:mysql://mysql:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: password
password: root
# 从库数据源
slave:
# 从数据源开关/默认关闭

View File

@ -1,34 +1,97 @@
# Tomcat
# 项目相关配置
ruoyi:
# 名称
name: RuoYi
# 版本
version: 3.8.6
# 版权年份
copyrightYear: 2023
# 实例演示开关
demoEnabled: true
# 文件路径 示例( Windows配置D:/ruoyi/uploadPathLinux配置 /home/ruoyi/uploadPath
profile: D:/ruoyi/uploadPath
# 获取ip地址开关
addressEnabled: false
# 验证码类型 math 数字计算 char 字符验证
captchaType: math
# 开发环境配置
server:
port: 9200
# 服务器的HTTP端口默认为8080
port: 8080
servlet:
# 应用的访问路径
context-path: /
tomcat:
# tomcat的URI编码
uri-encoding: UTF-8
# 连接数满后的排队数默认为100
accept-count: 1000
threads:
# tomcat最大线程数默认为200
max: 800
# Tomcat启动初始化的线程数默认值10
min-spare: 100
# Spring
# 日志配置
logging:
level:
com.ruoyi: debug
org.springframework: warn
# 用户配置
user:
password:
# 密码最大错误次数
maxRetryCount: 5
# 密码锁定时间默认10分钟
lockTime: 10
# Spring配置
spring:
application:
# 应用名称
name: muyu
# 资源信息
messages:
# 国际化资源文件路径
basename: i18n/messages
profiles:
# 环境配置
active: dev
# 文件上传
servlet:
multipart:
# 单个文件大小
max-file-size: 10MB
# 设置总上传的文件大小
max-request-size: 20MB
nacos:
config:
bootstrap:
#开启系统启动时预读取nacos的配置用于满足@Value注入数据的场景
enable: true
# 配置中心地址
server-addr: 127.0.0.1:8848
# 配置文件ID
data-id: ${spring.application.name}-${spring.profiles.active}.${nacos.config.file-extension}
# 配置文件格式
file-extension: yml
# 开启自动刷新nacos配置
auto-refresh: true
# 配置文件类型,对应nacos配置页面的配置格式默认是properties
type: yaml
# 针对配置项同名的情况是否允许nacos的配置覆盖本地的配置
remote-first: true
# 共享配置
ext-config:
- data-id: application.${nacos.config.file-extension}
type: yaml
# token配置
token:
# 令牌自定义标识
header: Authorization
# 令牌密钥
secret: abcdefghijklmnopqrstuvwxyz
# 令牌有效期默认30分钟
expireTime: 30
# MyBatis配置
mybatis:
# 配置mapper的扫描找到所有的mapper.xml映射文件
mapperLocations: classpath*:mapper/**/*Mapper.xml
# 加载全局的配置文件
configLocation: classpath:mybatis/mybatis-config.xml
# PageHelper分页插件
pagehelper:
helperDialect: mysql
supportMethodsArguments: true
params: count=countSql
# 防止XSS攻击
xss:
# 过滤开关
enabled: true
# 排除链接(多个用逗号分隔)
excludes: /system/notice
# 匹配链接
urlPatterns: /system/*,/monitor/*,/tool/*

View File

@ -13,7 +13,6 @@ import com.ruoyi.generator.service.GenTableService;
import org.apache.commons.io.IOUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;