mirror of
https://github.com/RockChinQ/QChatGPT.git
synced 2024-11-15 19:22:24 +08:00
perf: 支持识别docker环境
This commit is contained in:
parent
2471c5bf0f
commit
95784debbf
|
@ -5,6 +5,7 @@ COPY . .
|
|||
|
||||
RUN apt update \
|
||||
&& apt install gcc -y \
|
||||
&& python -m pip install -r requirements.txt
|
||||
&& python -m pip install -r requirements.txt \
|
||||
&& touch /.dockerenv
|
||||
|
||||
CMD [ "python", "main.py" ]
|
|
@ -3,7 +3,7 @@ from __future__ import annotations
|
|||
import sys
|
||||
|
||||
from .. import stage, app
|
||||
from ...utils import version, proxy, announce
|
||||
from ...utils import version, proxy, announce, platform
|
||||
from ...audit.center import v2 as center_v2
|
||||
from ...audit import identifier
|
||||
from ...pipeline import pool, controller, stagemgr
|
||||
|
@ -39,7 +39,7 @@ class BuildAppStage(stage.BootingStage):
|
|||
"host_id": identifier.identifier["host_id"],
|
||||
"instance_id": identifier.identifier["instance_id"],
|
||||
"semantic_version": ver_mgr.get_current_version(),
|
||||
"platform": sys.platform,
|
||||
"platform": platform.get_platform(),
|
||||
},
|
||||
runtime_info={
|
||||
"admin_id": "{}".format(ap.system_cfg.data["admin-sessions"]),
|
||||
|
|
|
@ -4,4 +4,8 @@ import sys
|
|||
|
||||
def get_platform() -> str:
|
||||
"""获取当前平台"""
|
||||
# 检查是不是在 docker 里
|
||||
if os.path.exists('/.dockerenv'):
|
||||
return 'docker'
|
||||
|
||||
return sys.platform
|
||||
|
|
Loading…
Reference in New Issue
Block a user