新增 [Eis.Tools (line 1)](C:/Users/BI/Documents/EIS-dotnet/src/Eis.Tools/Program.cs:1),支持 database init/reset/seed。
数据库维护、安全校验和事务逻辑位于 [DatabaseMaintenanceService.cs (line 1)](C:/Users/BI/Documents/EIS-dotnet/src/Eis.Infrastructure/Data/DatabaseMaintenanceService.cs:1)。 内置完整演示数据:1200 名考生、10800 条成绩、2404 条招生记录。 删除旧 import-test-data.mjs 和 reset-dev-database.mjs 运行入口。 Docker 镜像同时包含 Web 和 /app/tools/Eis.Tools.dll。 [package.json (line 11)](C:/Users/BI/Documents/EIS-dotnet/package.json:11) 原数据库命令已改为调用 .NET。 新增统一发布脚本:[publish.ps1 (line 1)](C:/Users/BI/Documents/EIS-dotnet/scripts/publish.ps1:1)。
This commit is contained in:
1 parent
e3c04dad8a
commit
f3ffc18aae
23 files changed
+1299
-281
No files matched your search
+6
-2
@@ -3,7 +3,9 @@ FROM mcr.microsoft.com/dotnet/sdk:10.0-bookworm-slim AS build
|
|||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN dotnet restore src/Eis.Web/Eis.Web.csproj \
|
RUN dotnet restore src/Eis.Web/Eis.Web.csproj \
|
||||||
&& dotnet publish src/Eis.Web/Eis.Web.csproj --configuration Release --output /app/publish --no-restore
|
&& dotnet restore src/Eis.Tools/Eis.Tools.csproj \
|
||||||
|
&& dotnet publish src/Eis.Web/Eis.Web.csproj --configuration Release --output /app/web --no-restore \
|
||||||
|
&& dotnet publish src/Eis.Tools/Eis.Tools.csproj --configuration Release --output /app/tools --no-restore
|
||||||
|
|
||||||
FROM mcr.microsoft.com/dotnet/aspnet:10.0-bookworm-slim AS runtime
|
FROM mcr.microsoft.com/dotnet/aspnet:10.0-bookworm-slim AS runtime
|
||||||
|
|
||||||
@@ -11,7 +13,8 @@ WORKDIR /app
|
|||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get install --yes --no-install-recommends curl \
|
&& apt-get install --yes --no-install-recommends curl \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
COPY --from=build --chown=$APP_UID:$APP_UID /app/publish .
|
COPY --from=build --chown=$APP_UID:$APP_UID /app/web /app/web
|
||||||
|
COPY --from=build --chown=$APP_UID:$APP_UID /app/tools /app/tools
|
||||||
RUN mkdir -p /app/data \
|
RUN mkdir -p /app/data \
|
||||||
&& chown -R $APP_UID:$APP_UID /app/data
|
&& chown -R $APP_UID:$APP_UID /app/data
|
||||||
|
|
||||||
@@ -24,6 +27,7 @@ EXPOSE 4173
|
|||||||
VOLUME ["/app/data"]
|
VOLUME ["/app/data"]
|
||||||
|
|
||||||
USER $APP_UID
|
USER $APP_UID
|
||||||
|
WORKDIR /app/web
|
||||||
|
|
||||||
HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 \
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 \
|
||||||
CMD ["curl", "--fail", "--silent", "--show-error", "http://127.0.0.1:4173/health/live"]
|
CMD ["curl", "--fail", "--silent", "--show-error", "http://127.0.0.1:4173/health/live"]
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
<Project Path="src/Eis.Application/Eis.Application.csproj" />
|
<Project Path="src/Eis.Application/Eis.Application.csproj" />
|
||||||
<Project Path="src/Eis.Domain/Eis.Domain.csproj" />
|
<Project Path="src/Eis.Domain/Eis.Domain.csproj" />
|
||||||
<Project Path="src/Eis.Infrastructure/Eis.Infrastructure.csproj" />
|
<Project Path="src/Eis.Infrastructure/Eis.Infrastructure.csproj" />
|
||||||
|
<Project Path="src/Eis.Tools/Eis.Tools.csproj" />
|
||||||
<Project Path="src/Eis.Web/Eis.Web.csproj" />
|
<Project Path="src/Eis.Web/Eis.Web.csproj" />
|
||||||
</Folder>
|
</Folder>
|
||||||
<Folder Name="/tests/">
|
<Folder Name="/tests/">
|
||||||
|
|||||||
+4
-2
@@ -11,6 +11,7 @@
|
|||||||
- [x] 指标资格、招生账户、志愿、计划、投档、录取、报到和退档
|
- [x] 指标资格、招生账户、志愿、计划、投档、录取、报到和退档
|
||||||
- [x] ClosedXML 文件导入导出、文书模板和 Redis/本机缓存
|
- [x] ClosedXML 文件导入导出、文书模板和 Redis/本机缓存
|
||||||
- [x] SQLite / MySQL 自动建库和基础配置初始化
|
- [x] SQLite / MySQL 自动建库和基础配置初始化
|
||||||
|
- [x] 可发布的 .NET 数据库重建与 1200 人演示数据导入工具
|
||||||
- [x] 容器入口切换及 Node.js 后端运行依赖移除
|
- [x] 容器入口切换及 Node.js 后端运行依赖移除
|
||||||
|
|
||||||
## 本地运行
|
## 本地运行
|
||||||
@@ -41,9 +42,10 @@ dotnet run --project .\src\Eis.Web\Eis.Web.csproj
|
|||||||
|
|
||||||
```powershell
|
```powershell
|
||||||
dotnet test .\Eis.slnx
|
dotnet test .\Eis.slnx
|
||||||
dotnet publish .\src\Eis.Web\Eis.Web.csproj -c Release
|
pwsh.exe -NoLogo -NoProfile -NonInteractive -File .\scripts\publish.ps1
|
||||||
|
dotnet .\artifacts\publish\tools\Eis.Tools.dll database seed --sqlite --path .\artifacts\demo.sqlite --dry-run
|
||||||
pwsh.exe -NoLogo -NoProfile -NonInteractive -File .\scripts\smoke-dotnet-native.ps1
|
pwsh.exe -NoLogo -NoProfile -NonInteractive -File .\scripts\smoke-dotnet-native.ps1
|
||||||
docker compose up --build --detach
|
docker compose up --build --detach
|
||||||
```
|
```
|
||||||
|
|
||||||
`scripts/smoke-dotnet-native.ps1` 会发布并启动纯 .NET 产物,在操作系统临时目录创建一次性 SQLite 数据库,检查健康状态、首页、CKEditor、原生登录和未知 API 404 后清理。`scripts/smoke-dotnet-migration.ps1` 保留为迁移期 Node/.NET 行为对照工具,不属于生产启动链路。
|
`Eis.Tools.dll` 提供 `database init/reset/seed`;破坏性命令要求 `--confirm-target`,SQLite 自动保留原库备份,MySQL 拒绝系统库和未显式强制覆盖的非演示业务数据。`scripts/smoke-dotnet-native.ps1` 会发布并启动纯 .NET 产物,在操作系统临时目录创建一次性 SQLite 数据库,检查健康状态、首页、CKEditor、原生登录和未知 API 404 后清理。`scripts/smoke-dotnet-migration.ps1` 保留为迁移期 Node/.NET 行为对照工具,不属于生产启动链路。
|
||||||
Loaded 3 of 23 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user