Przeglądaj źródła

fix: 将默认端口从8000更改为8500

yangkaixiang 3 tygodni temu
rodzic
commit
4b8ce85680
3 zmienionych plików z 7 dodań i 10 usunięć
  1. 3 6
      Dockerfile
  2. 3 3
      README.md
  3. 1 1
      instrument_config_mcp/server.py

+ 3 - 6
Dockerfile

@@ -16,14 +16,11 @@ RUN --mount=type=cache,target=/root/.cache/uv \
 
 FROM dev.data-turing.cn:14443/library/python:3.13-slim-bookworm AS runtime
 ENV PATH="/app/.venv/bin:$PATH" \
-    PYTHONUNBUFFERED=1 \
-    HOST="0.0.0.0" \
-    PORT="8000" \
-    MCP_TAVILY_UPSTREAM_BASE_URL="http://127.0.0.1:8101/mcp"
+    PYTHONUNBUFFERED=1
 RUN groupadd -g 1001 appgroup && \
     useradd -u 1001 -g appgroup -m -d /app -s /bin/false appuser
 WORKDIR /app
 COPY --from=build --chown=appuser:appgroup /app .
 USER appuser
-EXPOSE 8000
-CMD ["python", "-u", "-m", "backend.app"]
+EXPOSE 8500
+CMD ["python", "-u", "-m", "instrument_config_mcp.server"]

+ 3 - 3
README.md

@@ -68,7 +68,7 @@ uv sync --python 3.13
 
 ## 启动
 
-默认以 HTTP 模式启动,默认地址:`http://127.0.0.1:8000/mcp`
+默认以 HTTP 模式启动,默认地址:`http://127.0.0.1:8500/mcp`
 
 方式一:使用模块启动
 
@@ -85,7 +85,7 @@ uv run --python 3.13 instrument-config-mcp
 可选环境变量:
 
 - `MCP_HOST`,默认 `127.0.0.1`
-- `MCP_PORT`,默认 `8000`
+- `MCP_PORT`,默认 `8500`
 - `MCP_PATH`,默认 `/mcp`
 
 如果需要指定数据库:
@@ -99,7 +99,7 @@ uv run --python 3.13 python -m instrument_config_mcp
 
 ```bash
 set MCP_HOST=127.0.0.1
-set MCP_PORT=8000
+set MCP_PORT=8500
 set MCP_PATH=/mcp
 uv run --python 3.13 python -m instrument_config_mcp
 ```

+ 1 - 1
instrument_config_mcp/server.py

@@ -164,7 +164,7 @@ def search_meters(
 
 def main() -> None:
     host = os.getenv("MCP_HOST", "127.0.0.1").strip() or "127.0.0.1"
-    port = int(os.getenv("MCP_PORT", "8000"))
+    port = int(os.getenv("MCP_PORT", "8500"))
     path = os.getenv("MCP_PATH", "/mcp").strip() or "/mcp"
     mcp.run(transport="http", host=host, port=port, path=path)