mirror of
https://gitcode.com/ageerle/ruoyi-ai.git
synced 2026-09-12 16:05:05 +00:00
fix: 修复本地启动、数据库初始化与构建问题 (#314)
* fix: 修复本地启动、数据库初始化与构建问题 * fix: 修复pr的一些问题提交
This commit is contained in:
@@ -1,16 +1,14 @@
|
||||
# 基于官方MySQL 8.0镜像构建自定义镜像
|
||||
# 构建命令: docker build -t registry.cn-hangzhou.aliyuncs.com/ruoyi-ai/mysql:v3 -f Dockerfile.mysql .
|
||||
FROM mysql:8.0.33
|
||||
FROM mysql:8.0
|
||||
|
||||
# 设置时区
|
||||
ENV TZ=Asia/Shanghai
|
||||
|
||||
# 复制初始化脚本和SQL文件到镜像中
|
||||
COPY docs/script/docker/mysql/init/init-db.sh /docker-entrypoint-initdb.d/init-db.sh
|
||||
COPY docs/script/sql/ruoyi-ai-v3_mysql8.sql /docker-entrypoint-initdb.d/ruoyi-ai-v3_mysql8.sql
|
||||
|
||||
# 设置脚本可执行权限
|
||||
RUN chmod +x /docker-entrypoint-initdb.d/init-db.sh
|
||||
# MySQL 官方入口会按文件名顺序执行初始化目录中的 SQL。
|
||||
# ruoyi-ai.sql 会导入 MYSQL_DATABASE,snail_job_mysql.sql 会自行创建并切换数据库。
|
||||
COPY docs/script/sql/ruoyi-ai.sql /docker-entrypoint-initdb.d/01-ruoyi-ai.sql
|
||||
COPY docs/script/sql/snail_job_mysql.sql /docker-entrypoint-initdb.d/02-snail-job.sql
|
||||
|
||||
# MySQL启动参数
|
||||
CMD ["--default-authentication-plugin=mysql_native_password", \
|
||||
@@ -18,4 +16,4 @@ CMD ["--default-authentication-plugin=mysql_native_password", \
|
||||
"--collation-server=utf8mb4_general_ci", \
|
||||
"--explicit_defaults_for_timestamp=true", \
|
||||
"--lower_case_table_names=1", \
|
||||
"--skip-ssl"]
|
||||
"--skip-ssl"]
|
||||
|
||||
@@ -12,8 +12,6 @@
|
||||
#
|
||||
# 镜像仓库地址: crpi-31mraxd99y2gqdgr.cn-beijing.personal.cr.aliyuncs.com/ruoyi_ai
|
||||
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
# ==================== MySQL 数据库 ====================
|
||||
mysql:
|
||||
@@ -30,7 +28,10 @@ services:
|
||||
volumes:
|
||||
- mysql-data:/var/lib/mysql
|
||||
healthcheck:
|
||||
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-proot"]
|
||||
# Force TCP: during first-time initialization MySQL exposes a temporary
|
||||
# socket-only server. A socket ping would mark the service healthy before
|
||||
# the real network listener (used by the backend) is ready.
|
||||
test: ["CMD", "mysqladmin", "ping", "--protocol=tcp", "-h", "127.0.0.1", "-u", "root", "-proot"]
|
||||
interval: 15s
|
||||
timeout: 10s
|
||||
retries: 10
|
||||
@@ -177,4 +178,4 @@ volumes:
|
||||
weaviate-data:
|
||||
minio-data:
|
||||
logs-data:
|
||||
upload-data:
|
||||
upload-data:
|
||||
|
||||
@@ -21,8 +21,8 @@ services:
|
||||
MYSQL_DATABASE: ruoyi-ai-agent
|
||||
TZ: Asia/Shanghai
|
||||
volumes:
|
||||
- ./docs/script/docker/mysql/init/init-db.sh:/docker-entrypoint-initdb.d/init-db.sh:ro
|
||||
- ./docs/script/sql/ruoyi-ai-v3_mysql8.sql:/docker-entrypoint-initdb.d/ruoyi-ai-v3_mysql8.sql:ro
|
||||
- ../../script/sql/ruoyi-ai.sql:/docker-entrypoint-initdb.d/01-ruoyi-ai.sql:ro
|
||||
- ../../script/sql/snail_job_mysql.sql:/docker-entrypoint-initdb.d/02-snail-job.sql:ro
|
||||
- mysql-data:/var/lib/mysql
|
||||
command:
|
||||
--default-authentication-plugin=mysql_native_password
|
||||
@@ -32,7 +32,9 @@ services:
|
||||
--lower_case_table_names=1
|
||||
--skip-ssl
|
||||
healthcheck:
|
||||
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-proot"]
|
||||
# Do not let the socket-only initialization server satisfy the check.
|
||||
# The backend connects over TCP and must wait for that listener.
|
||||
test: ["CMD", "mysqladmin", "ping", "--protocol=tcp", "-h", "127.0.0.1", "-u", "root", "-proot"]
|
||||
interval: 15s
|
||||
timeout: 10s
|
||||
retries: 10
|
||||
|
||||
File diff suppressed because one or more lines are too long
545
docs/script/sql/snail_job_mysql.sql
Normal file
545
docs/script/sql/snail_job_mysql.sql
Normal file
File diff suppressed because it is too large
Load Diff
13
pom.xml
13
pom.xml
@@ -70,6 +70,7 @@
|
||||
<commons-compress.version>1.27.1</commons-compress.version>
|
||||
|
||||
<avatar-generator.version>1.1.0</avatar-generator.version>
|
||||
<javassist.version>3.30.2-GA</javassist.version>
|
||||
<jsoup.version>1.21.2</jsoup.version>
|
||||
<knife4j.version>4.4.0</knife4j.version>
|
||||
<swagger-annotations.version>2.2.8</swagger-annotations.version>
|
||||
@@ -503,20 +504,8 @@
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<!-- 关闭过滤 -->
|
||||
<filtering>false</filtering>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<!-- 引入所有 匹配文件进行过滤 -->
|
||||
<includes>
|
||||
<include>application*</include>
|
||||
<include>bootstrap*</include>
|
||||
<include>banner*</include>
|
||||
</includes>
|
||||
<!-- 启用过滤 即该资源中的变量将会被过滤器中的值替换 -->
|
||||
<filtering>true</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
</build>
|
||||
|
||||
|
||||
@@ -8,8 +8,8 @@ spring.boot.admin.client:
|
||||
metadata:
|
||||
username: ${spring.boot.admin.client.username}
|
||||
userpassword: ${spring.boot.admin.client.password}
|
||||
username: @monitor.username@
|
||||
password: @monitor.password@
|
||||
username: ${MONITOR_USERNAME:ruoyi}
|
||||
password: ${MONITOR_PASSWORD:123456}
|
||||
|
||||
--- # mcp配置信息
|
||||
mcp:
|
||||
|
||||
@@ -9,8 +9,8 @@ spring.boot.admin.client:
|
||||
metadata:
|
||||
username: ${spring.boot.admin.client.username}
|
||||
userpassword: ${spring.boot.admin.client.password}
|
||||
username: @monitor.username@
|
||||
password: @monitor.password@
|
||||
username: ${MONITOR_USERNAME:ruoyi}
|
||||
password: ${MONITOR_PASSWORD:123456}
|
||||
|
||||
--- # mcp配置信息
|
||||
mcp:
|
||||
|
||||
@@ -39,7 +39,7 @@ captcha:
|
||||
# 日志配置
|
||||
logging:
|
||||
level:
|
||||
org.ruoyi: @logging.level@
|
||||
org.ruoyi: ${LOGGING_LEVEL_ORG_RUOYI:info}
|
||||
org.springframework: warn
|
||||
org.mybatis.spring.mapper: error
|
||||
org.apache.fury: warn
|
||||
@@ -79,7 +79,7 @@ spring:
|
||||
# 国际化资源文件路径
|
||||
basename: i18n/messages
|
||||
profiles:
|
||||
active: @profiles.active@
|
||||
active: ${SPRING_PROFILES_ACTIVE:dev}
|
||||
# 文件上传
|
||||
servlet:
|
||||
multipart:
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
package org.ruoyi.common.chat.domain.bo.chat;
|
||||
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.ruoyi.common.chat.entity.chat.ChatModel;
|
||||
import org.ruoyi.common.core.validate.AddGroup;
|
||||
import org.ruoyi.common.core.validate.EditGroup;
|
||||
import org.ruoyi.common.mybatis.core.domain.BaseEntity;
|
||||
|
||||
@@ -28,16 +30,19 @@ public class ChatModelBo extends BaseEntity {
|
||||
/**
|
||||
* 模型分类
|
||||
*/
|
||||
@NotBlank(message = "模型分类不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String category;
|
||||
|
||||
/**
|
||||
* 模型名称
|
||||
*/
|
||||
@NotBlank(message = "模型名称不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String modelName;
|
||||
|
||||
/**
|
||||
* 模型供应商
|
||||
*/
|
||||
@NotBlank(message = "模型供应商不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String providerCode;
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,7 +4,7 @@ spring:
|
||||
application:
|
||||
name: ruoyi-monitor-admin
|
||||
profiles:
|
||||
active: @profiles.active@
|
||||
active: ${SPRING_PROFILES_ACTIVE:dev}
|
||||
|
||||
logging:
|
||||
config: classpath:logback-plus.xml
|
||||
@@ -13,8 +13,8 @@ logging:
|
||||
spring:
|
||||
security:
|
||||
user:
|
||||
name: @monitor.username@
|
||||
password: @monitor.password@
|
||||
name: ${MONITOR_USERNAME:ruoyi}
|
||||
password: ${MONITOR_PASSWORD:123456}
|
||||
boot:
|
||||
admin:
|
||||
ui:
|
||||
@@ -47,5 +47,5 @@ spring.boot.admin.client:
|
||||
metadata:
|
||||
username: ${spring.boot.admin.client.username}
|
||||
userpassword: ${spring.boot.admin.client.password}
|
||||
username: @monitor.username@
|
||||
password: @monitor.password@
|
||||
username: ${MONITOR_USERNAME:ruoyi}
|
||||
password: ${MONITOR_PASSWORD:123456}
|
||||
|
||||
@@ -2,7 +2,7 @@ spring:
|
||||
datasource:
|
||||
type: com.zaxxer.hikari.HikariDataSource
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
||||
url: jdbc:mysql://localhost:3306/snail_job?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
||||
username: root
|
||||
password: root
|
||||
hikari:
|
||||
@@ -47,5 +47,5 @@ spring.boot.admin.client:
|
||||
metadata:
|
||||
username: ${spring.boot.admin.client.username}
|
||||
userpassword: ${spring.boot.admin.client.password}
|
||||
username: @monitor.username@
|
||||
password: @monitor.password@
|
||||
username: ${MONITOR_USERNAME:ruoyi}
|
||||
password: ${MONITOR_PASSWORD:123456}
|
||||
|
||||
@@ -47,5 +47,5 @@ spring.boot.admin.client:
|
||||
metadata:
|
||||
username: ${spring.boot.admin.client.username}
|
||||
userpassword: ${spring.boot.admin.client.password}
|
||||
username: @monitor.username@
|
||||
password: @monitor.password@
|
||||
username: ${MONITOR_USERNAME:ruoyi}
|
||||
password: ${MONITOR_PASSWORD:123456}
|
||||
|
||||
@@ -7,7 +7,7 @@ spring:
|
||||
application:
|
||||
name: ruoyi-snailjob-server
|
||||
profiles:
|
||||
active: @profiles.active@
|
||||
active: ${SPRING_PROFILES_ACTIVE:dev}
|
||||
web:
|
||||
resources:
|
||||
static-locations: classpath:admin/
|
||||
|
||||
@@ -72,6 +72,21 @@
|
||||
<groupId>com.talanlabs</groupId>
|
||||
<artifactId>avatar-generator-cat</artifactId>
|
||||
<version>${avatar-generator.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.javassist</groupId>
|
||||
<artifactId>javassist</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<!-- avatar-generator-cat pulls an obsolete Javassist POM that Maven 3.9
|
||||
warns about. Reflections 0.9.10 is compatible with the maintained
|
||||
drop-in replacement. -->
|
||||
<dependency>
|
||||
<groupId>org.javassist</groupId>
|
||||
<artifactId>javassist</artifactId>
|
||||
<version>${javassist.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ import java.util.List;
|
||||
@AllArgsConstructor
|
||||
public class CompileNode {
|
||||
protected String id;
|
||||
@Builder.Default
|
||||
protected Boolean conditional = false;
|
||||
|
||||
/**
|
||||
@@ -24,5 +25,6 @@ public class CompileNode {
|
||||
* 2. 当前节点为条件分支节点,下游节点为多个节点,实际执行时只会执行一条
|
||||
* 两种节点根据是否GraphCompileNode来区分
|
||||
*/
|
||||
@Builder.Default
|
||||
protected List<CompileNode> nextNodes = new ArrayList<>();
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ import java.util.List;
|
||||
@NoArgsConstructor
|
||||
public class NodeProcessResult {
|
||||
|
||||
@Builder.Default
|
||||
private List<NodeIOData> content = new ArrayList<>();
|
||||
|
||||
/**
|
||||
@@ -25,6 +26,7 @@ public class NodeProcessResult {
|
||||
/**
|
||||
* 是否发生错误
|
||||
*/
|
||||
@Builder.Default
|
||||
private boolean error = false;
|
||||
|
||||
/**
|
||||
|
||||
@@ -26,7 +26,9 @@ class FfmpegCommandBuilderTest {
|
||||
List.of(source),
|
||||
TransitionType.NONE,
|
||||
0,
|
||||
AspectRatio.PORTRAIT
|
||||
AspectRatio.PORTRAIT,
|
||||
null,
|
||||
false
|
||||
);
|
||||
FfmpegFilterGraph graph = new FfmpegFilterGraph(
|
||||
"[0:v]null[v0]",
|
||||
|
||||
@@ -183,6 +183,6 @@ class FfmpegFilterGraphBuilderTest {
|
||||
List<CompositionSource> sources = java.util.stream.IntStream.range(0, sourceCount)
|
||||
.mapToObj(index -> new CompositionSource(Path.of("clip-" + index + ".mp4"), null))
|
||||
.toList();
|
||||
return new CompositionSpec(sources, transition, duration, ratio);
|
||||
return new CompositionSpec(sources, transition, duration, ratio, null, false);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user