Skip to content

Commit 400f649

Browse files
committed
feat(start-container): 添加new-api服务支持
在start-container.ps1脚本中添加了对new-api服务的支持,包括参数验证和容器启动配置。同时修复了DataPath赋值时的语法错误和one-api服务名称的引号格式问题。
1 parent 3523479 commit 400f649

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

‎start-container.ps1‎

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
param (
5858
[Parameter(Mandatory = $true)]
5959
[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+
'kokoro-fastapi-cpu', 'cadvisor', 'prometheus', 'noco', 'n8n', 'crawl4ai', 'pageSpy', 'new-api')]
6161
[string]$ServiceName, # 更合理的参数名
6262

6363
[ValidateSet("always", "unless-stopped", 'on-failure', 'on-failure:3', 'no')]
@@ -71,7 +71,7 @@ param (
7171
# 设置默认 docker 映射路径
7272
if (!$DataPath) {
7373
if ($IsWindows) {
74-
$DataPath = = "C:/docker_data"
74+
$DataPath = "C:/docker_data"
7575
}
7676
elseif ($IsLinux) {
7777
$DataPath = "/var/lib/docker_data"
@@ -190,7 +190,7 @@ switch ($ServiceName) {
190190
$env:MONGO_PASSWORD = $DefaultPassword
191191
docker-compose -p mongo-repl-dev -f dockerfiles/compose/mongo-repl.compose.yml up -d
192192
}
193-
‘one-api’ {
193+
'one-api' {
194194
docker run -d --name one-api-dev `
195195
$commonParams `
196196
-p 39010:3000 `
@@ -235,6 +235,15 @@ switch ($ServiceName) {
235235
--restart=$RestartPolicy `
236236
prom/prometheus
237237
}
238+
'new-api' {
239+
docker run -d --name new-api-dev `
240+
$commonParams `
241+
-p 3000:3000 `
242+
-e TZ=Asia/Shanghai `
243+
-v $DataPath/new-api:/data `
244+
--restart=$RestartPolicy `
245+
calciumion/new-api:latest
246+
}
238247
'n8n' {
239248
docker run -d --name n8n-dev `
240249
$commonParams `

0 commit comments

Comments
 (0)