docs: 更新文档
This commit is contained in:
parent
5a7f0e482d
commit
e124bcdadc
41
ReadMe.md
41
ReadMe.md
|
@ -27,12 +27,44 @@ Gitee地址
|
||||||
|
|
||||||
配置的端口号是8000根据自己需求进行更改
|
配置的端口号是8000根据自己需求进行更改
|
||||||
|
|
||||||
|
- 如果需要访问内部docker或者有这种需求访问宿主机docker,需要配置下面三个文件,这三个文件需要对应你的宿主机上的位置,下面展示的三个是服务容器中的地址,之后需要使用docker命令绑定映射这三个文件夹位置即可。
|
||||||
|
|
||||||
|
- ```
|
||||||
|
VOLUME /usr/bin/docker
|
||||||
|
VOLUME ["/var/run/docker.sock"]
|
||||||
|
VOLUME /etc/docker/daemon.json
|
||||||
|
```
|
||||||
|
|
||||||
|
- 备份资源和基础路径设置
|
||||||
|
|
||||||
|
- 备份资源如果是需要备份数据库,比如你的数据库就在本机那么可以使用这个文件夹,之后需要映射这个数据卷
|
||||||
|
|
||||||
|
- ```
|
||||||
|
VOLUME ["/www/root/backup"]
|
||||||
|
```
|
||||||
|
|
||||||
|
- 基础路径,比如需要设置前端配置文件的,因为第一次启动项目肯定是没有这个配置文件,而且打成jar包之后是不可以修改resource下资源的,需要将资源放到外面目录中
|
||||||
|
|
||||||
|
- 如果以后更新了服务,那么docker容器内容会被清空,比如备份的资源或者是配置的资源又要重新配置,这个地址挂载到数据卷中之后就可以映射,即使项目更新等文件也要,只要不把宿主机文件删除就可以。
|
||||||
|
|
||||||
|
- ```
|
||||||
|
VOLUME ["/www/root/server"]
|
||||||
|
```
|
||||||
|
|
||||||
![image-20241023094711026](data/images/image-20241023094711026.png)
|
![image-20241023094711026](data/images/image-20241023094711026.png)
|
||||||
|
|
||||||
部署命令
|
### 部署命令
|
||||||
|
|
||||||
|
仅供参考,实际的需要替换成你自己宿主机中的地址。
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker build -f Dockerfile -t bunny_auth_server:1.0.0 . && docker run -p 8000:8000 -v /usr/bin/docker:/usr/bin/docker -v /var/run/docker.sock:/var/run/docker.sock -v /etc/docker/daemon.json:/etc/docker/daemon.json -v /bunny/docker_data/mysql/slave_3304/backup:/home/backup --name bunny_auth_server --restart always bunny_auth_server:1.0.0
|
docker run -p 8000:8000 \
|
||||||
|
-v /usr/bin/docker:/usr/bin/docker \
|
||||||
|
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||||
|
-v /etc/docker/daemon.json:/etc/docker/daemon.json \
|
||||||
|
-v /bunny/docker_data/mysql/slave_3304/backup:/www/root/backup \
|
||||||
|
-v /bunny/docker_data/server:/www/root/server \
|
||||||
|
--name bunny_auth_server --restart always bunny_auth_server:1.0.0
|
||||||
```
|
```
|
||||||
|
|
||||||
### 代码生成器
|
### 代码生成器
|
||||||
|
@ -488,5 +520,6 @@ IDEA中也有集成只要使用了actuator包即可看到服务内容、健康
|
||||||
|
|
||||||
# 展望未来
|
# 展望未来
|
||||||
|
|
||||||
1. 定时邮件发送参数可在前端配置,动态形式
|
1. 首页看板内容
|
||||||
2. 首页看板内容
|
2. 服务器资源使用可视化展示
|
||||||
|
3. 将文件上传服务改成本地的oss,Minio感觉不需要未来会删除
|
|
@ -18,7 +18,8 @@ COPY target/*.jar /home/server/app.jar
|
||||||
VOLUME /usr/bin/docker
|
VOLUME /usr/bin/docker
|
||||||
VOLUME ["/var/run/docker.sock"]
|
VOLUME ["/var/run/docker.sock"]
|
||||||
VOLUME /etc/docker/daemon.json
|
VOLUME /etc/docker/daemon.json
|
||||||
VOLUME ["/home/backup"]
|
VOLUME ["/www/root/backup"]
|
||||||
|
VOLUME ["/www/root/server"]
|
||||||
|
|
||||||
# 启动容器时的进程
|
# 启动容器时的进程
|
||||||
ENTRYPOINT ["java","-jar","/home/server/app.jar"]
|
ENTRYPOINT ["java","-jar","/home/server/app.jar"]
|
||||||
|
|
|
@ -22,8 +22,8 @@ import java.util.concurrent.TimeUnit;
|
||||||
@Component
|
@Component
|
||||||
public class DatabaseBackupJob implements Job {
|
public class DatabaseBackupJob implements Job {
|
||||||
|
|
||||||
@Value("${bunny.bashPath}")
|
@Value("${bunny.backPath}")
|
||||||
private String bashPath;
|
private String backPath;
|
||||||
|
|
||||||
@SneakyThrows
|
@SneakyThrows
|
||||||
@Override
|
@Override
|
||||||
|
@ -32,12 +32,12 @@ public class DatabaseBackupJob implements Job {
|
||||||
try (InputStream inputStream = getClass().getClassLoader().getResourceAsStream("static/backup.sh")) {
|
try (InputStream inputStream = getClass().getClassLoader().getResourceAsStream("static/backup.sh")) {
|
||||||
if (inputStream == null) return;
|
if (inputStream == null) return;
|
||||||
byte[] bytes = inputStream.readAllBytes();
|
byte[] bytes = inputStream.readAllBytes();
|
||||||
Files.write(Path.of(bashPath + "/backup.sh"), bytes);
|
Files.write(Path.of(backPath + "/backup.sh"), bytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 执行脚本
|
// 执行脚本
|
||||||
System.setProperty("TERM", "xterm");
|
System.setProperty("TERM", "xterm");
|
||||||
ProcessBuilder processBuilder = new ProcessBuilder("sh", bashPath + "/backup.sh");
|
ProcessBuilder processBuilder = new ProcessBuilder("sh", backPath + "/backup.sh");
|
||||||
processBuilder.redirectErrorStream(true);
|
processBuilder.redirectErrorStream(true);
|
||||||
Process process = processBuilder.start();
|
Process process = processBuilder.start();
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -25,6 +26,7 @@ import java.util.List;
|
||||||
* @since 2024-10-19 01:01:01
|
* @since 2024-10-19 01:01:01
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
|
@Transactional
|
||||||
public class UserLoginLogServiceImpl extends ServiceImpl<UserLoginLogMapper, UserLoginLog> implements UserLoginLogService {
|
public class UserLoginLogServiceImpl extends ServiceImpl<UserLoginLogMapper, UserLoginLog> implements UserLoginLogService {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@ -53,8 +55,8 @@ public class UserLoginLogServiceImpl extends ServiceImpl<UserLoginLogMapper, Use
|
||||||
@Override
|
@Override
|
||||||
public void deleteUserLoginLog(List<Long> ids) {
|
public void deleteUserLoginLog(List<Long> ids) {
|
||||||
// 逻辑删除
|
// 逻辑删除
|
||||||
baseMapper.deleteBatchIds(ids);
|
removeBatchByIds(ids);
|
||||||
|
|
||||||
// 物理删除
|
// 物理删除
|
||||||
// baseMapper.deleteBatchIdsWithPhysics(ids);
|
// baseMapper.deleteBatchIdsWithPhysics(ids);
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,4 +38,5 @@ bunny:
|
||||||
secretKey: "02120212"
|
secretKey: "02120212"
|
||||||
bucket-name: auth-admin
|
bucket-name: auth-admin
|
||||||
|
|
||||||
bashPath: "D:\\MyFolder"
|
backPath: "D:\\MyFolder\\backup"
|
||||||
|
bashPath: "D:\\MyFolder"
|
||||||
|
|
|
@ -16,7 +16,7 @@ logging:
|
||||||
pattern:
|
pattern:
|
||||||
dateformat: HH:mm:ss:SSS
|
dateformat: HH:mm:ss:SSS
|
||||||
file:
|
file:
|
||||||
path: "logs/${spring.application.name}" aaa
|
path: "logs/${spring.application.name}"
|
||||||
|
|
||||||
# 线上禁用文档
|
# 线上禁用文档
|
||||||
knife4j:
|
knife4j:
|
||||||
|
@ -25,11 +25,11 @@ knife4j:
|
||||||
|
|
||||||
bunny:
|
bunny:
|
||||||
master:
|
master:
|
||||||
host: 106.15.251.123
|
host: rm-bp12z6hlv46vi6g8mro.mysql.rds.aliyuncs.com
|
||||||
port: 3306
|
port: 3306
|
||||||
database: auth_admin
|
database: auth_admin
|
||||||
username: root
|
username: auth_admin_prod
|
||||||
password: "02120212"
|
password: 0212auth_admin
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
host: 47.120.65.66
|
host: 47.120.65.66
|
||||||
|
@ -43,4 +43,5 @@ bunny:
|
||||||
secretKey: "02120212"
|
secretKey: "02120212"
|
||||||
bucket-name: auth-admin
|
bucket-name: auth-admin
|
||||||
|
|
||||||
bashPath: "/home/server"
|
backPath: "/www/root/backup"
|
||||||
|
bashPath: "/www/root/server"
|
|
@ -47,22 +47,23 @@ knife4j:
|
||||||
|
|
||||||
bunny:
|
bunny:
|
||||||
master:
|
master:
|
||||||
host: rm-bp12z6hlv46vi6g8mro.mysql.rds.aliyuncs.com
|
host: 192.168.3.98
|
||||||
port: 3306
|
port: 3304
|
||||||
database: auth_admin
|
database: auth_admin
|
||||||
username: auth_admin_prod
|
username: root
|
||||||
password: 0212auth_admin
|
|
||||||
|
|
||||||
redis:
|
|
||||||
host: 47.120.65.66
|
|
||||||
port: 6379
|
|
||||||
database: 0
|
|
||||||
password: "02120212"
|
password: "02120212"
|
||||||
|
|
||||||
|
redis:
|
||||||
|
host: 192.168.3.98
|
||||||
|
port: 6379
|
||||||
|
database: 0
|
||||||
|
password: "123456"
|
||||||
|
|
||||||
minio:
|
minio:
|
||||||
endpointUrl: "http://116.196.101.14:9000"
|
endpointUrl: "http://192.168.3.98:9000"
|
||||||
accessKey: bunny
|
accessKey: bunny
|
||||||
secretKey: "02120212"
|
secretKey: "02120212"
|
||||||
bucket-name: auth-admin
|
bucket-name: auth-admin
|
||||||
|
|
||||||
bashPath: "/home/server"
|
backPath: "/www/root/backup"
|
||||||
|
bashPath: "/www/root/server"
|
Loading…
Reference in New Issue