Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pac
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai-tools
pac
Commits
918a2844
Commit
918a2844
authored
Aug 04, 2026
by
luoqi
Browse files
Options
Browse Files
Download
Plain Diff
merge: fix/docs-api-url → main(docs OpenAPI 地址随环境)
parents
bda06ca4
ab0f7101
Pipeline
#3537
failed in 0 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
2 deletions
+18
-2
apps/pac-service/tests/compose-logging.spec.ts
+11
-0
docker-compose.prod.yml
+7
-2
No files found.
apps/pac-service/tests/compose-logging.spec.ts
View file @
918a2844
...
@@ -45,3 +45,14 @@ describe('docker-compose.prod.yml 日志驱动', () => {
...
@@ -45,3 +45,14 @@ describe('docker-compose.prod.yml 日志驱动', () => {
expect
(
compose
.
services
[
'pac-asr'
]
!
.
profiles
).
toContain
(
'asr'
);
expect
(
compose
.
services
[
'pac-asr'
]
!
.
profiles
).
toContain
(
'asr'
);
});
});
});
});
describe
(
'docs OpenAPI server 地址'
,
()
=>
{
test
(
'⭐ 不硬编码域名 —— 这份 compose 测试服与生产共用,写死会让生产 docs 打到测试服'
,
()
=>
{
const
args
=
(
compose
.
services
[
'pac-docs'
]
as
{
build
?:
{
args
?:
Record
<
string
,
string
>
}
}).
build
?.
args
??
{};
const
v
=
args
[
'DOCS_API_URL'
]
??
''
;
expect
(
v
).
toMatch
(
/^
\$\{
/
);
// 必须是变量插值
expect
(
v
).
not
.
toMatch
(
/jarvismedical|friday
\.
tech/
);
// 不得出现任何具体域名
// 复用 NEXT_PUBLIC_API_BASE_URL:它就是同一个东西,各环境 .env 已有,不会再漂移
expect
(
v
).
toContain
(
'NEXT_PUBLIC_API_BASE_URL'
);
});
});
docker-compose.prod.yml
View file @
918a2844
...
@@ -163,8 +163,13 @@ services:
...
@@ -163,8 +163,13 @@ services:
dockerfile
:
apps/pac-docs/Dockerfile
dockerfile
:
apps/pac-docs/Dockerfile
target
:
prod
target
:
prod
args
:
args
:
# OpenAPI 参考页 Scalar 的 server 地址(cURL/Send base);本地默认 localhost:3101,线上注入生产域名
# OpenAPI 参考页 Scalar 的 server 地址(cURL/Send base)。
DOCS_API_URL
:
https://pac.jarvismedical.asia
# ⚠️ 曾硬编码成 https://pac.jarvismedical.asia(测试服域名)—— 而这份 compose 是
# **测试服与生产共用**的,于是生产 docs 页上点"发送请求"会打到测试服去。
# 改为复用 NEXT_PUBLIC_API_BASE_URL:它就是同一个东西(API 的对外地址),
# 各环境 apps/pac-web/.env 里本来就有,零额外配置、且不会再随环境漂移。
# 要单独指定时才设 DOCS_API_URL 覆盖;都没有则退回本地。
DOCS_API_URL
:
${DOCS_API_URL:-${NEXT_PUBLIC_API_BASE_URL:-http://localhost:3101}}
restart
:
always
restart
:
always
environment
:
environment
:
NODE_ENV
:
production
NODE_ENV
:
production
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment