chore(env): WEB_PORT 统一回退为 5173 并烟雾检查改为可开关

- .env.example/docker-compose(.full).yml WEB_PORT 默认值 5273→5173(Vite 默认),CORS_ORIGINS 同步
- docker-compose 注入 WEB_PORT/SERVER_PORT 环境变量,健康检查端口随之更新
- start.sh 新增 SERVER_SMOKE_CHECK_ENABLED 开关,默认关闭烟雾检查,仅健康探测
- web/web_start.sh 适配端口
- .gitignore 补充忽略 tmp/ 运行时目录
This commit is contained in:
caoxiaozhu
2026-06-23 09:42:40 +08:00
parent e725b7f19c
commit dc4cad2baa
6 changed files with 24 additions and 9 deletions

View File

@@ -14,9 +14,9 @@ VITE_ADMIN_EMAIL=
# Admin login credentials are stored separately under server/.secrets/
WEB_HOST=0.0.0.0
WEB_PORT=5273
WEB_PORT=5173
VITE_WEB_HOST=0.0.0.0
VITE_WEB_PORT=5273
VITE_WEB_PORT=5173
SERVER_HOST=0.0.0.0
SERVER_PORT=8000
@@ -52,4 +52,4 @@ OCR_DEVICE=
OCR_TIMEOUT_SECONDS=180
OCR_MAX_CONCURRENT_WORKERS=1
CORS_ORIGINS='["http://127.0.0.1:5273","http://localhost:5273","http://0.0.0.0:5273"]'
CORS_ORIGINS='["http://127.0.0.1:5173","http://localhost:5173","http://0.0.0.0:5173"]'

1
.gitignore vendored
View File

@@ -25,6 +25,7 @@ server/storage/receipt_folder/
test-results/
.codex-remote-attachments/
tmp-*.png
tmp/
.nezha/
.omo/
.env

View File

@@ -12,7 +12,9 @@ services:
condition: service_started
environment:
WEB_HOST: 0.0.0.0
WEB_PORT: "${WEB_PORT:-5173}"
SERVER_HOST: 0.0.0.0
SERVER_PORT: "${SERVER_PORT:-8000}"
SERVER_VENV_DIR: /tmp/x-financial-server-venv
X_FINANCIAL_PREFER_ENV_FILE: "false"
POSTGRES_HOST: postgres
@@ -28,7 +30,7 @@ services:
QDRANT_URL: "http://qdrant:6333"
LIGHTRAG_WORKSPACE: "x_financial_knowledge"
ports:
- "${WEB_PORT:-5273}:${WEB_PORT:-5273}"
- "${WEB_PORT:-5173}:${WEB_PORT:-5173}"
- "${SERVER_PORT:-8000}:${SERVER_PORT:-8000}"
- "2223:22"
volumes:
@@ -67,7 +69,7 @@ services:
cd /app &&
./start.sh all
healthcheck:
test: ["CMD-SHELL", "curl -fsS http://127.0.0.1:${WEB_PORT:-5273}/ >/dev/null || exit 1"]
test: ["CMD-SHELL", "curl -fsS http://127.0.0.1:${WEB_PORT:-5173}/ >/dev/null || exit 1"]
interval: 15s
timeout: 5s
retries: 10

View File

@@ -5,7 +5,9 @@ services:
restart: unless-stopped
environment:
WEB_HOST: 0.0.0.0
WEB_PORT: "${WEB_PORT:-5173}"
SERVER_HOST: 0.0.0.0
SERVER_PORT: "${SERVER_PORT:-8000}"
SERVER_VENV_DIR: /tmp/x-financial-server-venv
X_FINANCIAL_PREFER_ENV_FILE: "true"
ONLYOFFICE_ENABLED: "${ONLYOFFICE_ENABLED:-false}"
@@ -15,7 +17,7 @@ services:
QDRANT_URL: "${QDRANT_URL:-}"
LIGHTRAG_WORKSPACE: "x_financial_knowledge"
ports:
- "${WEB_PORT:-5273}:${WEB_PORT:-5273}"
- "${WEB_PORT:-5173}:${WEB_PORT:-5173}"
- "${SERVER_PORT:-8000}:${SERVER_PORT:-8000}"
- "2223:22"
volumes:
@@ -54,7 +56,7 @@ services:
cd /app &&
./start.sh all
healthcheck:
test: ["CMD-SHELL", "curl -fsS http://127.0.0.1:${WEB_PORT:-5273}/ >/dev/null || exit 1"]
test: ["CMD-SHELL", "curl -fsS http://127.0.0.1:${WEB_PORT:-5173}/ >/dev/null || exit 1"]
interval: 15s
timeout: 5s
retries: 10

View File

@@ -109,6 +109,7 @@ if [ "$ENV_OVERRIDE_ONLYOFFICE_JWT_SECRET_SET" = true ]; then
fi
SERVER_STARTUP_TIMEOUT="${SERVER_STARTUP_TIMEOUT:-300}"
SERVER_SMOKE_CHECK_ENABLED="${SERVER_SMOKE_CHECK_ENABLED:-false}"
SETUP_COMPLETED="${SETUP_COMPLETED:-false}"
APP_DEBUG="${APP_DEBUG:-true}"
APP_ENV="${APP_ENV:-local}"
@@ -220,7 +221,16 @@ probe_server_ready() {
_health_url="${1:-$(server_probe_url)}"
_smoke_url="${2:-$(server_smoke_url)}"
probe_server_health "$_health_url" && probe_server_smoke "$_smoke_url"
probe_server_health "$_health_url" || return 1
case "$SERVER_SMOKE_CHECK_ENABLED" in
1|true|TRUE|yes|YES|on|ON)
probe_server_smoke "$_smoke_url"
return $?
;;
esac
return 0
}
prepare_web() {

View File

@@ -90,7 +90,7 @@ if [ "${X_FINANCIAL_FORCE_SETUP:-false}" = "true" ]; then
fi
WEB_HOST="${WEB_HOST:-0.0.0.0}"
WEB_PORT="${WEB_PORT:-5273}"
WEB_PORT="${WEB_PORT:-5173}"
export VITE_SETUP_COMPLETED="${SETUP_COMPLETED:-false}"
export VITE_COMPANY_NAME="${COMPANY_NAME:-}"