{{ route.meta.title || 'SVN 工作台' }}
+{{ route.meta.desc || '' }}
+diff --git a/.gitignore b/.gitignore index c06c52a..687b526 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,12 @@ +# frontend-vue (Vue 3 + Vite) +frontend-vue/node_modules/ + +# frontend build output (auto-generated by Docker build) +src/main/resources/static/v2/ + +# Backup directory +outputs.nobody-backup-*/ + # Maven target/ pom.xml.tag diff --git a/Dockerfile b/Dockerfile index 343a011..6d4809b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,19 +1,57 @@ -# syntax=docker/dockerfile:1.7 +# ============================================================ +# Docker 镜像仓库加速(默认使用 docker.1ms.run 国内代理) +# 如需切换回 Docker Hub: +# docker compose build --build-arg REGISTRY_MIRROR=docker.io/library +# ============================================================ +ARG REGISTRY_MIRROR=docker.1ms.run/library + +# ============================================================ +# Stage 1: 前端构建(Vue 3 + Vite) +# ============================================================ +FROM ${REGISTRY_MIRROR}/node:22-alpine AS frontend-builder + +WORKDIR /frontend + +COPY frontend-vue/package.json frontend-vue/package-lock.json ./ + +RUN npm ci + +COPY frontend-vue/ ./ + +RUN npm run build + +# ============================================================ +# Stage 2: 后端构建(Maven + Java 8) +# ============================================================ +FROM ${REGISTRY_MIRROR}/maven:3.9.6-eclipse-temurin-8 AS builder + +# Maven JVM 调优:增大堆内存、启用并行 +ENV MAVEN_OPTS="-Xmx2g -XX:MaxMetaspaceSize=512m -Djava.util.concurrent.ForkJoinPool.common.parallelism=4" -FROM maven:3.9.6-eclipse-temurin-8 AS builder WORKDIR /app +# 使用阿里云 Maven 镜像加速依赖下载(替换 Maven Central) +COPY maven-settings.xml /root/.m2/settings.xml + COPY pom.xml . RUN --mount=type=cache,target=/root/.m2 \ - mvn -B -DskipTests dependency:go-offline + mvn -B -DskipTests -T 1C dependency:go-offline COPY src ./src -RUN --mount=type=cache,target=/root/.m2 \ - mvn -B -DskipTests clean package +# 将前端构建产物注入静态资源目录(Maven 会自动打包进 jar) +# vite.config.js 中 outDir 为相对 __dirname 的路径,容器内 __dirname=/frontend +COPY --from=frontend-builder /src/main/resources/static/v2 /app/src/main/resources/static/v2 -FROM eclipse-temurin:8-jre +# -T 1C: 按 CPU 核数并行; -o: 离线模式(依赖已缓存,跳过元数据检查) +RUN --mount=type=cache,target=/root/.m2 \ + mvn -B -DskipTests -T 1C -o clean package + +# ============================================================ +# Stage 3: 运行镜像(最小化 JRE) +# ============================================================ +FROM ${REGISTRY_MIRROR}/eclipse-temurin:8-jre-alpine WORKDIR /app COPY --from=builder /app/target/svn-log-tool-1.0.0-jar-with-dependencies.jar app.jar diff --git a/Makefile b/Makefile index be2b1c2..00d26c6 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,10 @@ +# ============================================================ +# Docker Hub 镜像代理(默认使用 docker.1ms.run 加速) +# 如果需要切换回 Docker Hub: +# DOCKER_REGISTRY_MIRROR=docker.io/library make up +# ============================================================ +DOCKER_REGISTRY_MIRROR ?= docker.1ms.run/library + .PHONY: up down status COMPOSE_CMD := $(shell if command -v docker >/dev/null 2>&1 && docker compose version >/dev/null 2>&1; then echo "docker compose"; elif command -v docker-compose >/dev/null 2>&1; then echo "docker-compose"; fi) @@ -5,7 +12,7 @@ BUILD_ENV := DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 up: @if [ -z "$(COMPOSE_CMD)" ]; then echo "docker compose/docker-compose not found"; exit 1; fi - @$(BUILD_ENV) $(COMPOSE_CMD) up -d --build + @REGISTRY_MIRROR=$(DOCKER_REGISTRY_MIRROR) $(BUILD_ENV) $(COMPOSE_CMD) up -d --build @echo "Application is starting at http://localhost:18088" down: diff --git a/docker-compose.yml b/docker-compose.yml index 949cde5..094728d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,9 +3,12 @@ services: build: context: . dockerfile: Dockerfile + args: + # Docker 镜像加速(默认 Docker Hub,国内可设阿里云) + # 使用方式: REGISTRY_MIRROR=registry.cn-hangzhou.aliyuncs.com/library docker compose build + REGISTRY_MIRROR: ${REGISTRY_MIRROR:-docker.1ms.run/library} container_name: svn-log-tool - ports: - - "18088:18088" + network_mode: host volumes: - ./outputs:/app/outputs restart: unless-stopped diff --git a/docs/README_Web.md b/docs/README_Web.md index 0d3af14..9e04743 100644 --- a/docs/README_Web.md +++ b/docs/README_Web.md @@ -93,6 +93,7 @@ http://localhost:18088 - `POST /api/svn/test-connection` - `POST /api/svn/fetch` +- `POST /api/svn/version-range`:按 `rangeType=date|week|month` 查询版本范围;旧的 `year/month` 月份请求仍兼容 - `GET /api/svn/presets` - `POST /api/ai/analyze` - `GET /api/tasks` diff --git a/frontend-vue/index.html b/frontend-vue/index.html new file mode 100644 index 0000000..c58f512 --- /dev/null +++ b/frontend-vue/index.html @@ -0,0 +1,17 @@ + + +
+ + + + +{{ route.meta.desc || '' }}
+| 任务ID | +类型 | +状态 | +进度 | +说明 | +产物 | +操作 | +
|---|---|---|---|---|---|---|
| {{ t.taskId.slice(0, 8) }} | +{{ t.type }} | +{{ t.status }} | +{{ t.progress || 0 }}% | +
+
+ {{ t.error }}
+ |
+ + + {{ basename(f) }} + + - + | ++ + - + | +
| 暂无任务记录 | +||||||
| 文件路径 | +大小 | +更新时间 | +操作 | +
|---|---|---|---|
| {{ f.path }} | +{{ formatBytes(f.size) }} | +{{ formatTime(f.modifiedAt) }} | +下载 | +
| 暂无输出文件 | +|||
查看系统状态与最近产物
-等待思考输出...
-等待答案输出...
-等待任务开始...
-