From dc4cad2baa15f56f1eba17cb2f80064e09a2d0bc Mon Sep 17 00:00:00 2001 From: caoxiaozhu Date: Tue, 23 Jun 2026 09:42:40 +0800 Subject: [PATCH] =?UTF-8?q?chore(env):=20WEB=5FPORT=20=E7=BB=9F=E4=B8=80?= =?UTF-8?q?=E5=9B=9E=E9=80=80=E4=B8=BA=205173=20=E5=B9=B6=E7=83=9F?= =?UTF-8?q?=E9=9B=BE=E6=A3=80=E6=9F=A5=E6=94=B9=E4=B8=BA=E5=8F=AF=E5=BC=80?= =?UTF-8?q?=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - .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/ 运行时目录 --- .env.example | 6 +++--- .gitignore | 1 + docker-compose.full.yml | 6 ++++-- docker-compose.yml | 6 ++++-- start.sh | 12 +++++++++++- web/web_start.sh | 2 +- 6 files changed, 24 insertions(+), 9 deletions(-) diff --git a/.env.example b/.env.example index 325be74..df3588f 100644 --- a/.env.example +++ b/.env.example @@ -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"]' diff --git a/.gitignore b/.gitignore index 9e9e889..324da5e 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,7 @@ server/storage/receipt_folder/ test-results/ .codex-remote-attachments/ tmp-*.png +tmp/ .nezha/ .omo/ .env diff --git a/docker-compose.full.yml b/docker-compose.full.yml index 65bc2bc..1c017a6 100644 --- a/docker-compose.full.yml +++ b/docker-compose.full.yml @@ -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 diff --git a/docker-compose.yml b/docker-compose.yml index 2680bb1..3e0371a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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 diff --git a/start.sh b/start.sh index 7e4dd45..3f76e3e 100755 --- a/start.sh +++ b/start.sh @@ -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() { diff --git a/web/web_start.sh b/web/web_start.sh index e4baf9d..0e5a961 100755 --- a/web/web_start.sh +++ b/web/web_start.sh @@ -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:-}"