零 Node 部署、超级管理员,并完善本地构建发布文档。
- FastAPI 单进程托管 frontend/dist,systemd 替代 PM2 - 超级管理员 admin、注册开关与用户管理 - README/DEPLOY/USAGE 说明:改代码须本地构建 dist 后 push,服务器 update.sh - 提交 frontend/dist 与 build-frontend 脚本
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
# 本地构建前端并提示提交 dist(开发机执行,服务器不构建)
|
||||
$ErrorActionPreference = "Stop"
|
||||
$Root = Split-Path -Parent (Split-Path -Parent $MyInvocation.MyCommand.Path)
|
||||
Set-Location (Join-Path $Root "frontend")
|
||||
|
||||
Write-Host "[INFO] 安装依赖并构建前端…"
|
||||
npm ci
|
||||
npm run build
|
||||
|
||||
if (-not (Test-Path "dist\index.html")) {
|
||||
Write-Error "构建失败:未生成 dist\index.html"
|
||||
}
|
||||
|
||||
Write-Host ""
|
||||
Write-Host "构建完成。请提交并推送:"
|
||||
Write-Host " git add frontend/dist"
|
||||
Write-Host ' git commit -m "build: update frontend dist"'
|
||||
Write-Host " git push"
|
||||
Write-Host ""
|
||||
Write-Host "服务器更新:"
|
||||
Write-Host " bash /opt/secondary-school-grade-archive/deploy/update.sh"
|
||||
Reference in New Issue
Block a user