|
56 | 56 | [CmdletBinding()] |
57 | 57 | param ( |
58 | 58 | [Parameter(Mandatory = $true)] |
59 | | - [ValidateSet("minio", "redis", 'postgre', 'etcd', 'nacos', 'rabbitmq', 'mongodb', 'one-api', 'mongodb-replica', 'kokoro-fastapi', 'kokoro-fastapi-cpu', 'cadvisor', 'prometheus', 'noco', 'n8n', 'crawl4ai')] |
| 59 | + [ValidateSet("minio", "redis", 'postgre', 'etcd', 'nacos', 'rabbitmq', 'mongodb', 'one-api', 'mongodb-replica', 'kokoro-fastapi', |
| 60 | + 'kokoro-fastapi-cpu', 'cadvisor', 'prometheus', 'noco', 'n8n', 'crawl4ai', 'pageSpy')] |
60 | 61 | [string]$ServiceName, # 更合理的参数名 |
61 | 62 |
|
62 | 63 | [ValidateSet("always", "unless-stopped", 'on-failure', 'on-failure:3', 'no')] |
63 | 64 | [string]$RestartPolicy = 'unless-stopped', # 更明确的参数名 |
64 | 65 |
|
65 | | - [string]$DataPath = "C:/docker_data" ,# 允许自定义数据目录 |
| 66 | + [string]$DataPath ,# 允许自定义数据目录 |
66 | 67 | [string]$DefaultUser = "root", # 默认用户名 |
67 | 68 | [string]$DefaultPassword = "12345678" # 默认密码 |
68 | 69 | ) |
69 | 70 |
|
70 | | - |
| 71 | +# 设置默认 docker 映射路径 |
| 72 | +if (!$DataPath) { |
| 73 | + if ($IsWindows) { |
| 74 | + $DataPath = = "C:/docker_data" |
| 75 | + } |
| 76 | + elseif ($IsLinux) { |
| 77 | + $DataPath = "/var/lib/docker_data" |
| 78 | + } |
| 79 | + elseif ($IsMacOS) { |
| 80 | + $DataPath = "/Volumes/Data/docker_data" |
| 81 | + } |
| 82 | +} |
71 | 83 | # 可以添加统一网络配置 |
72 | 84 | # $networkName = "dev-net" |
73 | 85 | # if (-not (docker network ls -q -f name="$networkName")) { |
@@ -247,4 +259,14 @@ switch ($ServiceName) { |
247 | 259 | --restart=$RestartPolicy ` |
248 | 260 | unclecode/crawl4ai:latest |
249 | 261 | } |
| 262 | + "pageSpy" { |
| 263 | + docker run -d --name pageSpy-dev ` |
| 264 | + $commonParams ` |
| 265 | + -p 6752:6752 ` |
| 266 | + --restart=$RestartPolicy ` |
| 267 | + -v $DataPath/pageSpy/log:/app/log ` |
| 268 | + -v $DataPath/pageSpy/data:/app/data ` |
| 269 | + ghcr.io/huolalatech/page-spy-web:latest |
| 270 | + |
| 271 | + } |
250 | 272 | } |
0 commit comments