将检测任务迁移python
This commit is contained in:
63
ruoyi-admin/Dockerfile
Normal file
63
ruoyi-admin/Dockerfile
Normal file
@@ -0,0 +1,63 @@
|
||||
# 构建阶段
|
||||
FROM maven:3.8-eclipse-temurin-17 AS builder
|
||||
|
||||
# 设置工作目录
|
||||
WORKDIR /build
|
||||
|
||||
# 复制pom文件
|
||||
COPY pom.xml .
|
||||
COPY ruoyi-admin/pom.xml ./ruoyi-admin/
|
||||
COPY ruoyi-common/pom.xml ./ruoyi-common/
|
||||
COPY ruoyi-framework/pom.xml ./ruoyi-framework/
|
||||
COPY ruoyi-generator/pom.xml ./ruoyi-generator/
|
||||
COPY ruoyi-quartz/pom.xml ./ruoyi-quartz/
|
||||
COPY ruoyi-system/pom.xml ./ruoyi-system/
|
||||
COPY ruoyi-video/pom.xml ./ruoyi-video/
|
||||
|
||||
# 下载依赖
|
||||
RUN mvn dependency:go-offline -B
|
||||
|
||||
# 复制源代码
|
||||
COPY ruoyi-admin/src ./ruoyi-admin/src
|
||||
COPY ruoyi-common/src ./ruoyi-common/src
|
||||
COPY ruoyi-framework/src ./ruoyi-framework/src
|
||||
COPY ruoyi-generator/src ./ruoyi-generator/src
|
||||
COPY ruoyi-quartz/src ./ruoyi-quartz/src
|
||||
COPY ruoyi-system/src ./ruoyi-system/src
|
||||
COPY ruoyi-video/src ./ruoyi-video/src
|
||||
COPY ArcFace64.dat ./
|
||||
|
||||
# 构建项目
|
||||
RUN mvn clean package -DskipTests -pl ruoyi-admin -am
|
||||
|
||||
# 运行阶段
|
||||
FROM eclipse-temurin:17-jre-alpine
|
||||
|
||||
# 安装必要的工具
|
||||
RUN apk add --no-cache curl tzdata && \
|
||||
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
|
||||
echo "Asia/Shanghai" > /etc/timezone && \
|
||||
apk del tzdata
|
||||
|
||||
# 设置工作目录
|
||||
WORKDIR /app
|
||||
|
||||
# 创建日志和上传目录
|
||||
RUN mkdir -p /app/logs /app/upload
|
||||
|
||||
# 复制jar包和配置文件
|
||||
COPY --from=builder /build/ruoyi-admin/target/ruoyi-admin.jar /app/app.jar
|
||||
COPY --from=builder /build/ArcFace64.dat /app/
|
||||
|
||||
# 设置环境变量
|
||||
ENV JAVA_OPTS="-Xms512m -Xmx1024m -Djava.security.egd=file:/dev/./urandom"
|
||||
|
||||
# 暴露端口(仅内部使用)
|
||||
EXPOSE 8080
|
||||
|
||||
# 健康检查
|
||||
HEALTHCHECK --interval=30s --timeout=10s --retries=3 --start-period=60s \
|
||||
CMD curl -f http://localhost:8080/actuator/health || exit 1
|
||||
|
||||
# 启动应用
|
||||
ENTRYPOINT ["sh", "-c", "java ${JAVA_OPTS} -jar /app/app.jar"]
|
||||
@@ -30,6 +30,12 @@
|
||||
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- spring-boot-actuator for health check -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Mysql驱动包 -->
|
||||
<dependency>
|
||||
<groupId>com.mysql</groupId>
|
||||
|
||||
@@ -101,7 +101,7 @@ public class CommonController
|
||||
// persist to v_minio_object
|
||||
VMinioObject record = new VMinioObject();
|
||||
record.setObjectName(fileName);
|
||||
record.setUrl(url);
|
||||
record.setObjectUrl(url);
|
||||
record.setOriginalName(file.getOriginalFilename());
|
||||
try { record.setCreateBy(SecurityUtils.getUsername()); } catch (Exception ignored) {}
|
||||
vMinioObjectService.insert(record);
|
||||
@@ -158,7 +158,7 @@ public class CommonController
|
||||
// persist each to v_minio_object
|
||||
VMinioObject record = new VMinioObject();
|
||||
record.setObjectName(fileName);
|
||||
record.setUrl(url);
|
||||
record.setObjectUrl(url);
|
||||
record.setOriginalName(file.getOriginalFilename());
|
||||
try { record.setCreateBy(SecurityUtils.getUsername()); } catch (Exception ignored) {}
|
||||
vMinioObjectService.insert(record);
|
||||
|
||||
@@ -156,10 +156,6 @@ mediasServer:
|
||||
# 无人拉流观看持续多久自动关闭,1分钟
|
||||
noClientsDuration: 60000
|
||||
|
||||
# 虹软sdk
|
||||
arcFace:
|
||||
appId: '替换成你的appId'
|
||||
sdkKey: '替换成你的sdkKey'
|
||||
|
||||
# 视频分析配置
|
||||
video:
|
||||
@@ -174,3 +170,17 @@ video:
|
||||
transport: tcp
|
||||
# 重试次数
|
||||
retryCount: 3
|
||||
|
||||
# Spring Boot Actuator配置
|
||||
management:
|
||||
endpoints:
|
||||
web:
|
||||
exposure:
|
||||
include: health,info
|
||||
base-path: /actuator
|
||||
endpoint:
|
||||
health:
|
||||
show-details: when-authorized
|
||||
health:
|
||||
defaults:
|
||||
enabled: true
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
[
|
||||
{"name":"garbage","path":"libs/models/garbage","size":[640,640],"backend":"OpenCV"},
|
||||
{"name":"smoke","path":"libs/models/smoke","size":[640,640],"backend":"OpenCV"}
|
||||
|
||||
{
|
||||
"name": "garbage",
|
||||
"pythonModelName": "garbage_detector",
|
||||
"pythonApiUrl": "http://localhost:8000/api/detect/file"
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user