Files
quick-share/docker/deploy.ps1

22 lines
606 B
PowerShell

# 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"