From 2f9a37738c056ef9933f802c59ae4e83b9931c3f Mon Sep 17 00:00:00 2001 From: BryantHe Date: Thu, 10 Aug 2023 12:43:19 +0800 Subject: [PATCH] update doc --- app/api/v1/api.py | 2 +- docker-compose.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/api/v1/api.py b/app/api/v1/api.py index 6ebc495..6f3656c 100644 --- a/app/api/v1/api.py +++ b/app/api/v1/api.py @@ -10,7 +10,7 @@ api = APIBlueprint('api', __name__) @api.get('/hello') def hello(): - result_one = f'我是您的专属接口提供服务器: {platform.node()}' + result_one = f'我是您的专属接口提供服务器: {os.environ["HOSTNAME"]}' result_two = f'我的机器参数如下' result_three = f'操作系统:{platform.system()},CPU 核数:{psutil.cpu_count()},目前 CPU 占用率: {psutil.cpu_percent()}' text = """ diff --git a/docker-compose.yml b/docker-compose.yml index bb32ad8..ed8049d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -14,6 +14,7 @@ services: environment: TZ: "Asia/Shanghai" LOG_LEVEL: "DEBUG" + HOSTNAME: $(cat /etc/hostname) env_file: - .apiflaskenv - .apiflask.env