mirror of
https://gitcode.com/ageerle/ruoyi-ai.git
synced 2026-04-06 08:17:31 +00:00
feat: 重构模块
This commit is contained in:
@@ -1,61 +0,0 @@
|
||||
version: '3'
|
||||
|
||||
services:
|
||||
# 此镜像仅用于测试 正式环境需自行安装数据库
|
||||
# SID: XE user: system password: oracle
|
||||
oracle:
|
||||
image: tekintian/oracle12c:latest
|
||||
container_name: oracle
|
||||
environment:
|
||||
# 时区上海
|
||||
TZ: Asia/Shanghai
|
||||
DBCA_TOTAL_MEMORY: 16192
|
||||
ports:
|
||||
- "18080:8080"
|
||||
- "1521:1521"
|
||||
volumes:
|
||||
# 数据挂载
|
||||
- "/docker/oracle/data:/u01/app/oracle"
|
||||
network_mode: "host"
|
||||
|
||||
# 此镜像仅用于测试 正式环境需自行安装数据库
|
||||
sqlserver:
|
||||
image: mcr.microsoft.com/mssql/server:2017-latest
|
||||
container_name: sqlserver
|
||||
environment:
|
||||
# 时区上海
|
||||
TZ: Asia/Shanghai
|
||||
ACCEPT_EULA: "Y"
|
||||
SA_PASSWORD: "ruoyi@123"
|
||||
ports:
|
||||
- "1433:1433"
|
||||
volumes:
|
||||
# 数据挂载
|
||||
- "/docker/sqlserver/data:/var/opt/mssql"
|
||||
network_mode: "host"
|
||||
|
||||
postgres:
|
||||
image: postgres:14.2
|
||||
container_name: postgres
|
||||
environment:
|
||||
POSTGRES_USER: root
|
||||
POSTGRES_PASSWORD: root
|
||||
POSTGRES_DB: postgres
|
||||
ports:
|
||||
- "5432:5432"
|
||||
volumes:
|
||||
- /docker/postgres/data:/var/lib/postgresql/data
|
||||
network_mode: "host"
|
||||
|
||||
postgres13:
|
||||
image: postgres:13.6
|
||||
container_name: postgres13
|
||||
environment:
|
||||
POSTGRES_USER: root
|
||||
POSTGRES_PASSWORD: root
|
||||
POSTGRES_DB: postgres
|
||||
ports:
|
||||
- "5433:5432"
|
||||
volumes:
|
||||
- /docker/postgres13/data:/var/lib/postgresql/data
|
||||
network_mode: "host"
|
||||
@@ -1,64 +0,0 @@
|
||||
version: '3'
|
||||
|
||||
services:
|
||||
mysql:
|
||||
image: mysql:8.0.33
|
||||
container_name: mysql
|
||||
environment:
|
||||
TZ: Asia/Shanghai
|
||||
MYSQL_ROOT_PASSWORD: root
|
||||
MYSQL_DATABASE: ry-vue
|
||||
ports:
|
||||
- "3307:3306"
|
||||
volumes:
|
||||
- ./ry-vue.sql:/docker-entrypoint-initdb.d/ry-vue.sql
|
||||
command:
|
||||
--default-authentication-plugin=mysql_native_password
|
||||
--character-set-server=utf8mb4
|
||||
--collation-server=utf8mb4_general_ci
|
||||
--explicit_defaults_for_timestamp=true
|
||||
--lower_case_table_names=1
|
||||
|
||||
ruoyi-server:
|
||||
image: registry.cn-shanghai.aliyuncs.com/ruoyi-ai/ai:1.2.1
|
||||
ports:
|
||||
- "6039:6039"
|
||||
container_name: ruoyi-server
|
||||
environment:
|
||||
TZ: Asia/Shanghai
|
||||
# 运行端口号
|
||||
SERVER_PORT: 6039
|
||||
# 数据库连接地址
|
||||
DB_URL: jdbc:mysql://mysql:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
|
||||
# 数据库用户名
|
||||
DB_USERNAME: root
|
||||
# 数据库用户密码
|
||||
DB_PASSWORD: root
|
||||
# Redis地址
|
||||
REDIS_HOST: redis
|
||||
# Redis端口
|
||||
REDIS_PORT: 6379
|
||||
# 数据库索引
|
||||
REDIS_DATABASE: 0
|
||||
# Redis密码
|
||||
REDIS_PASSWORD:
|
||||
# 连接超时时间
|
||||
REDIS_TIMEOUT: 10s
|
||||
volumes:
|
||||
- /docker/server2/logs/:/ruoyi/server/logs/
|
||||
|
||||
ruoyi-web:
|
||||
image: registry.cn-shanghai.aliyuncs.com/ruoyi-ai/web:1.2.1
|
||||
ports:
|
||||
- "8081:8081"
|
||||
container_name: ruoyi-web
|
||||
|
||||
|
||||
ruoyi-admin:
|
||||
image: registry.cn-shanghai.aliyuncs.com/ruoyi-ai/admin:1.2.1
|
||||
ports:
|
||||
- "8082:8082"
|
||||
container_name: ruoyi-admin
|
||||
|
||||
|
||||
|
||||
@@ -1,111 +0,0 @@
|
||||
worker_processes 1;
|
||||
|
||||
error_log /var/log/nginx/error.log warn;
|
||||
pid /var/run/nginx.pid;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
include mime.types;
|
||||
default_type application/octet-stream;
|
||||
sendfile on;
|
||||
keepalive_timeout 65;
|
||||
# 限制body大小
|
||||
client_max_body_size 100m;
|
||||
|
||||
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
||||
'$status $body_bytes_sent "$http_referer" '
|
||||
'"$http_user_agent" "$http_x_forwarded_for"';
|
||||
|
||||
access_log /var/log/nginx/access.log main;
|
||||
|
||||
upstream server {
|
||||
ip_hash;
|
||||
server 127.0.0.1:8080;
|
||||
server 127.0.0.1:8081;
|
||||
}
|
||||
|
||||
upstream monitor-admin {
|
||||
server 127.0.0.1:9090;
|
||||
}
|
||||
|
||||
upstream xxljob-admin {
|
||||
server 127.0.0.1:9100;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
|
||||
# https配置参考 start
|
||||
#listen 443 ssl;
|
||||
|
||||
# 证书直接存放 /docker/nginx/cert/ 目录下即可 更改证书名称即可 无需更改证书路径
|
||||
#ssl on;
|
||||
#ssl_certificate /etc/nginx/cert/xxx.local.crt; # /etc/nginx/cert/ 为docker映射路径 不允许更改
|
||||
#ssl_certificate_key /etc/nginx/cert/xxx.local.key; # /etc/nginx/cert/ 为docker映射路径 不允许更改
|
||||
#ssl_session_timeout 5m;
|
||||
#ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
|
||||
#ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
|
||||
#ssl_prefer_server_ciphers on;
|
||||
# https配置参考 end
|
||||
|
||||
# 演示环境配置 拦截除 GET POST 之外的所有请求
|
||||
# if ($request_method !~* GET|POST) {
|
||||
# rewrite ^/(.*)$ /403;
|
||||
# }
|
||||
|
||||
# location = /403 {
|
||||
# default_type application/json;
|
||||
# return 200 '{"msg":"演示模式,不允许操作","code":500}';
|
||||
# }
|
||||
|
||||
# 限制外网访问内网 actuator 相关路径
|
||||
location ~ ^(/[^/]*)?/actuator(/.*)?$ {
|
||||
return 403;
|
||||
}
|
||||
|
||||
location / {
|
||||
root /usr/share/nginx/html;
|
||||
try_files $uri $uri/ /index.html;
|
||||
index index.html index.htm;
|
||||
}
|
||||
|
||||
location /prod-api/ {
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header REMOTE-HOST $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_pass http://server/;
|
||||
}
|
||||
|
||||
# https 会拦截内链所有的 http 请求 造成功能无法使用
|
||||
# 解决方案1 将 admin 服务 也配置成 https
|
||||
# 解决方案2 将菜单配置为外链访问 走独立页面 http 访问
|
||||
location /admin/ {
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header REMOTE-HOST $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_pass http://monitor-admin/admin/;
|
||||
}
|
||||
|
||||
# https 会拦截内链所有的 http 请求 造成功能无法使用
|
||||
# 解决方案1 将 xxljob 服务 也配置成 https
|
||||
# 解决方案2 将菜单配置为外链访问 走独立页面 http 访问
|
||||
location /xxl-job-admin/ {
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header REMOTE-HOST $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_pass http://xxljob-admin/xxl-job-admin/;
|
||||
}
|
||||
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
location = /50x.html {
|
||||
root html;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
# redis 密码
|
||||
requirepass ruoyi123
|
||||
|
||||
# key 监听器配置
|
||||
# notify-keyspace-events Ex
|
||||
|
||||
# 配置持久化文件存储路径
|
||||
dir /redis/data
|
||||
# 配置rdb
|
||||
# 15分钟内有至少1个key被更改则进行快照
|
||||
save 900 1
|
||||
# 5分钟内有至少10个key被更改则进行快照
|
||||
save 300 10
|
||||
# 1分钟内有至少10000个key被更改则进行快照
|
||||
save 60 10000
|
||||
# 开启压缩
|
||||
rdbcompression yes
|
||||
# rdb文件名 用默认的即可
|
||||
dbfilename dump.rdb
|
||||
|
||||
# 开启aof
|
||||
appendonly yes
|
||||
# 文件名
|
||||
appendfilename "appendonly.aof"
|
||||
# 持久化策略,no:不同步,everysec:每秒一次,always:总是同步,速度比较慢
|
||||
# appendfsync always
|
||||
appendfsync everysec
|
||||
# appendfsync no
|
||||
@@ -1 +0,0 @@
|
||||
数据目录 请执行 `chmod 777 /docker/redis/data` 赋予读写权限 否则将无法写入数据
|
||||
@@ -1 +1 @@
|
||||
INSERT INTO `ry-vue`.`chat_app_store` (`id`, `name`, `description`, `avatar`, `app_url`, `create_dept`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (7, '微信机器人', '微信机器人', 'https://panda-1253683406.cos.ap-guangzhou.myqcloud.com/panda/2025/04/02/0557a7d68fa842bba952ce0d6ef38a2e.png', '/wxbot', NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
INSERT INTO `chat_app_store` (`id`, `name`, `description`, `avatar`, `app_url`, `create_dept`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (7, '微信机器人', '微信机器人', 'https://panda-1253683406.cos.ap-guangzhou.myqcloud.com/panda/2025/04/02/0557a7d68fa842bba952ce0d6ef38a2e.png', '/wxbot', NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
SET FOREIGN_KEY_CHECKS=0;
|
||||
|
||||
ALTER TABLE `ruoyi-org`.`chat_gpts` ADD COLUMN `model_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '模型名称' AFTER `tenant_id`;
|
||||
|
||||
ALTER TABLE `ruoyi-org`.`chat_gpts` ADD COLUMN `system_prompt` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '系统提示词' AFTER `model_name`;
|
||||
|
||||
INSERT INTO `ruoyi-ai`.`chat_gpts` (`id`, `gid`, `name`, `logo`, `info`, `author_id`, `author_name`, `use_cnt`, `bad`, `type`, `create_dept`, `create_time`, `create_by`, `update_by`, `update_time`, `remark`, `version`, `del_flag`, `update_ip`, `tenant_id`, `model_name`, `system_prompt`) VALUES (1810602934286237698, 'gpt-4-gizmo-g-RQAWjtI6u', '翻译助手', 'https://external-content.duckduckgo.com/ip3/chat.openai.com.ico', '中英和英中翻译专家', 'winkey', 'winkey', 0, 0, 'vector', 103, '2024-07-09 17:12:34', '1', '1', '2025-04-07 21:44:11', 'Ms. Smith, the AI-powered Language Teacher, is a revolutionary GPT-based bot that offers personalized language learning experiences in over 20 languages, including Spanish, German, French, English, Chinese, Korean, Japanese, and more\n', NULL, '0', '127.0.0.1', 0, 'deepseek-r1:1.5b', '你是一位精通各国语言的翻译大师\r\n\r\n请将用户输入词语翻译成英文或中文\r\n\r\n==示例输出==\r\n**原文** : <这里显示要翻译的原文信息>\r\n**翻译** : <这里显示翻译成英语的结果>\r\n==示例结束==\r\n\r\n注意:请严格按示例进行输出,返回markdown格式');
|
||||
INSERT INTO `ruoyi-ai`.`chat_gpts` (`id`, `gid`, `name`, `logo`, `info`, `author_id`, `author_name`, `use_cnt`, `bad`, `type`, `create_dept`, `create_time`, `create_by`, `update_by`, `update_time`, `remark`, `version`, `del_flag`, `update_ip`, `tenant_id`, `model_name`, `system_prompt`) VALUES (1811668415990931458, 'gpt-4-gizmo-g-XbReEL4Uq', '清北全科医生', 'https://external-content.duckduckgo.com/ip3/chat.openai.com.ico', '富有同情心的全科医生提供健康指导', NULL, NULL, 0, 0, NULL, 103, '2024-07-12 15:46:24', '1', '1', '2024-07-12 15:46:24', NULL, NULL, '0', NULL, 0, 'deepseek-r1:1.5b', '富有同情心的全科医生提供健康指导');
|
||||
INSERT INTO `ruoyi-ai`.`chat_gpts` (`id`, `gid`, `name`, `logo`, `info`, `author_id`, `author_name`, `use_cnt`, `bad`, `type`, `create_dept`, `create_time`, `create_by`, `update_by`, `update_time`, `remark`, `version`, `del_flag`, `update_ip`, `tenant_id`, `model_name`, `system_prompt`) VALUES (1811670922074988545, 'gpt-4-gizmo-g-AphhNRLxt', '提示词优化', 'https://external-content.duckduckgo.com/ip3/chat.openai.com.ico', '擅长为Prompt 提升清晰度和创造力的大师', NULL, NULL, 0, 0, NULL, 103, '2024-07-12 15:56:22', '1', '1', '2024-07-12 15:56:22', NULL, NULL, '0', NULL, 0, 'deepseek-r1:1.5b', '擅长为Prompt 提升清晰度和创造力的大师');
|
||||
INSERT INTO `ruoyi-ai`.`chat_gpts` (`id`, `gid`, `name`, `logo`, `info`, `author_id`, `author_name`, `use_cnt`, `bad`, `type`, `create_dept`, `create_time`, `create_by`, `update_by`, `update_time`, `remark`, `version`, `del_flag`, `update_ip`, `tenant_id`, `model_name`, `system_prompt`) VALUES (1811815442062188545, 'gpt-4-gizmo-g-ThuHxKi7e', '小红书文案生成器', 'https://external-content.duckduckgo.com/ip3/chat.openai.com.ico', '小红书文案生成器', NULL, NULL, 0, 0, NULL, 103, '2024-07-13 01:30:38', '1', '1', '2024-07-13 01:30:38', NULL, NULL, '0', NULL, 0, 'deepseek-r1:1.5b', '小红书文案生成器');
|
||||
INSERT INTO `ruoyi-ai`.`chat_gpts` (`id`, `gid`, `name`, `logo`, `info`, `author_id`, `author_name`, `use_cnt`, `bad`, `type`, `create_dept`, `create_time`, `create_by`, `update_by`, `update_time`, `remark`, `version`, `del_flag`, `update_ip`, `tenant_id`, `model_name`, `system_prompt`) VALUES (1811817605668741121, 'gpt-4-gizmo-g-AsQCd3k8', '中国法律助手', 'https://external-content.duckduckgo.com/ip3/chat.openai.com.ico', '全面掌握中国法律的智能助手,可帮助起草文书,分析案件,进行法律咨询', NULL, NULL, 0, 0, NULL, 103, '2024-07-13 01:39:14', '1', '1', '2024-07-13 01:39:14', NULL, NULL, '2', NULL, 0, 'deepseek-r1:1.5b', '全面掌握中国法律的智能助手,可帮助起草文书,分析案件,进行法律咨询');
|
||||
INSERT INTO `ruoyi-ai`.`chat_gpts` (`id`, `gid`, `name`, `logo`, `info`, `author_id`, `author_name`, `use_cnt`, `bad`, `type`, `create_dept`, `create_time`, `create_by`, `update_by`, `update_time`, `remark`, `version`, `del_flag`, `update_ip`, `tenant_id`, `model_name`, `system_prompt`) VALUES (1811817605668741122, 'gpt-4-gizmo-g-IXwub6dJu', '英语老师', 'https://external-content.duckduckgo.com/ip3/chat.openai.com.ico', '英语学习GPT是一个专门设计来帮助用户提高他们的英语技能的人工智能助手', NULL, NULL, 0, 0, NULL, NULL, NULL, '', '', NULL, NULL, NULL, '0', NULL, 0, 'deepseek-r1:1.5b', '英语学习GPT是一个专门设计来帮助用户提高他们的英语技能的人工智能助手');
|
||||
|
||||
SET FOREIGN_KEY_CHECKS=1;
|
||||
@@ -1,4 +1,4 @@
|
||||
INSERT INTO `ruoyi-ai`.`chat_model` (`id`, `tenant_id`, `category`, `model_name`, `model_describe`, `model_price`, `model_type`, `model_show`, `system_prompt`, `api_host`, `api_key`, `create_dept`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1907575746601119746, '000000', 'vector', 'text-embedding-3-small', 'text-embedding-3-small', 0, '2', '0', NULL, 'https://api.pandarobot.chat/', 'sk-cdBlIaZcufccm2RaDe547cBd054d49C7B0782eCa72A0052b', 103, 1, '2025-04-03 07:27:54', 1, '2025-04-03 07:27:54', 'text-embedding-3-small');
|
||||
INSERT INTO `ruoyi-ai`.`chat_model` (`id`, `tenant_id`, `category`, `model_name`, `model_describe`, `model_price`, `model_type`, `model_show`, `system_prompt`, `api_host`, `api_key`, `create_dept`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1907576007017066497, '000000', 'vector', 'quentinz/bge-large-zh-v1.5', 'bge-large-zh-v1.5', 0, '2', '0', NULL, 'https://api.pandarobot.chat/', 'cdBlIaZcufccm2RaDe547cBd054d49C7B0782eCa72A0052b', 103, 1, '2025-04-03 07:28:56', 1, '2025-04-03 07:28:56', 'bge-large-zh-v1.5');
|
||||
INSERT INTO `ruoyi-ai`.`chat_model` (`id`, `tenant_id`, `category`, `model_name`, `model_describe`, `model_price`, `model_type`, `model_show`, `system_prompt`, `api_host`, `api_key`, `create_dept`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1907576806191362049, '000000', 'vector', 'nomic-embed-text', 'nomic-embed-text', 0, '2', '0', NULL, 'http://127.0.0.1:11434/', 'nomic-embed-text', 103, 1, '2025-04-03 07:32:06', 1, '2025-04-03 07:32:06', 'nomic-embed-text');
|
||||
INSERT INTO `ruoyi-ai`.`chat_model` (`id`, `tenant_id`, `category`, `model_name`, `model_describe`, `model_price`, `model_type`, `model_show`, `system_prompt`, `api_host`, `api_key`, `create_dept`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1907577073490161665, '000000', 'vector', 'snowflake-arctic-embed', 'snowflake-arctic-embed', 0, '2', '0', NULL, 'http://127.0.0.1:11434/', 'snowflake-arctic-embed', 103, 1, '2025-04-03 07:33:10', 1, '2025-04-03 07:33:10', 'snowflake-arctic-embed');
|
||||
INSERT INTO `chat_model` (`id`, `tenant_id`, `category`, `model_name`, `model_describe`, `model_price`, `model_type`, `model_show`, `system_prompt`, `api_host`, `api_key`, `create_dept`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1907575746601119746, '000000', 'vector', 'text-embedding-3-small', 'text-embedding-3-small', 0, '2', '0', NULL, 'https://api.pandarobot.chat/', 'sk-cdBlIaZcufccm2RaDe547cBd054d49C7B0782eCa72A0052b', 103, 1, '2025-04-03 07:27:54', 1, '2025-04-03 07:27:54', 'text-embedding-3-small');
|
||||
INSERT INTO `chat_model` (`id`, `tenant_id`, `category`, `model_name`, `model_describe`, `model_price`, `model_type`, `model_show`, `system_prompt`, `api_host`, `api_key`, `create_dept`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1907576007017066497, '000000', 'vector', 'quentinz/bge-large-zh-v1.5', 'bge-large-zh-v1.5', 0, '2', '0', NULL, 'https://api.pandarobot.chat/', 'cdBlIaZcufccm2RaDe547cBd054d49C7B0782eCa72A0052b', 103, 1, '2025-04-03 07:28:56', 1, '2025-04-03 07:28:56', 'bge-large-zh-v1.5');
|
||||
INSERT INTO `chat_model` (`id`, `tenant_id`, `category`, `model_name`, `model_describe`, `model_price`, `model_type`, `model_show`, `system_prompt`, `api_host`, `api_key`, `create_dept`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1907576806191362049, '000000', 'vector', 'nomic-embed-text', 'nomic-embed-text', 0, '2', '0', NULL, 'http://127.0.0.1:11434/', 'nomic-embed-text', 103, 1, '2025-04-03 07:32:06', 1, '2025-04-03 07:32:06', 'nomic-embed-text');
|
||||
INSERT INTO `chat_model` (`id`, `tenant_id`, `category`, `model_name`, `model_describe`, `model_price`, `model_type`, `model_show`, `system_prompt`, `api_host`, `api_key`, `create_dept`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1907577073490161665, '000000', 'vector', 'snowflake-arctic-embed', 'snowflake-arctic-embed', 0, '2', '0', NULL, 'http://127.0.0.1:11434/', 'snowflake-arctic-embed', 103, 1, '2025-04-03 07:33:10', 1, '2025-04-03 07:33:10', 'snowflake-arctic-embed');
|
||||
|
||||
Reference in New Issue
Block a user