Initial commit: DataTool backend, frontend and Docker
This commit is contained in:
21
docker/deploy.ps1
Normal file
21
docker/deploy.ps1
Normal file
@@ -0,0 +1,21 @@
|
||||
# DataTool 一键部署:拉取代码 -> 进入 docker 目录 -> 构建并启动
|
||||
# 用法: .\deploy.ps1 [-NoPull]
|
||||
|
||||
param([switch]$NoPull)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
# 脚本在 docker/ 下,仓库根目录为上一级
|
||||
$RepoRoot = Split-Path $PSScriptRoot -Parent
|
||||
Set-Location $RepoRoot
|
||||
|
||||
if (-not $NoPull) {
|
||||
Write-Host ">>> 拉取最新代码..."
|
||||
git pull 2>$null
|
||||
}
|
||||
|
||||
Write-Host ">>> 进入 docker 目录并执行构建、启动..."
|
||||
Set-Location (Join-Path $RepoRoot "docker")
|
||||
docker compose build --no-cache
|
||||
docker compose up -d
|
||||
|
||||
Write-Host ">>> 部署完成。访问 http://localhost:8080"
|
||||
Reference in New Issue
Block a user