Skip to content

Commit a438bee

Browse files
committed
2 parents d6b0e39 + a32c91b commit a438bee

1 file changed

Lines changed: 25 additions & 3 deletions

File tree

start-container.ps1

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,30 @@
5656
[CmdletBinding()]
5757
param (
5858
[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')]
6061
[string]$ServiceName, # 更合理的参数名
6162

6263
[ValidateSet("always", "unless-stopped", 'on-failure', 'on-failure:3', 'no')]
6364
[string]$RestartPolicy = 'unless-stopped', # 更明确的参数名
6465

65-
[string]$DataPath = "C:/docker_data" ,# 允许自定义数据目录
66+
[string]$DataPath ,# 允许自定义数据目录
6667
[string]$DefaultUser = "root", # 默认用户名
6768
[string]$DefaultPassword = "12345678" # 默认密码
6869
)
6970

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+
}
7183
# 可以添加统一网络配置
7284
# $networkName = "dev-net"
7385
# if (-not (docker network ls -q -f name="$networkName")) {
@@ -247,4 +259,14 @@ switch ($ServiceName) {
247259
--restart=$RestartPolicy `
248260
unclecode/crawl4ai:latest
249261
}
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+
}
250272
}

0 commit comments

Comments
 (0)