fix:启动端口改由环境变量控制
This commit is contained in:
@@ -17,7 +17,7 @@ class Settings(BaseSettings):
|
|||||||
extra='ignore' # 忽略环境变量中多余的键
|
extra='ignore' # 忽略环境变量中多余的键
|
||||||
)
|
)
|
||||||
# 启动端口
|
# 启动端口
|
||||||
SERVE_PROD: int = Field(default=8000, description='')
|
SERVE_PORT: int = Field(default=8000, description='')
|
||||||
# 调试配饰
|
# 调试配饰
|
||||||
LOCAL: int = Field(default=0, description="是否在本地运行,1表示本地运行,0表示生产环境运行")
|
LOCAL: int = Field(default=0, description="是否在本地运行,1表示本地运行,0表示生产环境运行")
|
||||||
|
|
||||||
|
|||||||
@@ -27,4 +27,4 @@ if __name__ == "__main__":
|
|||||||
agent_api = LCAgent(enable_async=True, api_path='/api/v1/agent')
|
agent_api = LCAgent(enable_async=True, api_path='/api/v1/agent')
|
||||||
reface_api = ReFace(api_path='/api/v1/reface')
|
reface_api = ReFace(api_path='/api/v1/reface')
|
||||||
server = ls.LitServer([chat_boot_api, agent_api, reface_api])
|
server = ls.LitServer([chat_boot_api, agent_api, reface_api])
|
||||||
server.run(port=settings.SERVE_PROD)
|
server.run(port=8000)
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ services:
|
|||||||
- ./google_application_credentials.json:/google_application_credentials.json
|
- ./google_application_credentials.json:/google_application_credentials.json
|
||||||
- /etc/localtime:/etc/localtime:ro
|
- /etc/localtime:/etc/localtime:ro
|
||||||
ports:
|
ports:
|
||||||
- "10070:8000"
|
- "${SERVE_PORT}:8000"
|
||||||
deploy:
|
deploy:
|
||||||
resources:
|
resources:
|
||||||
reservations:
|
reservations:
|
||||||
|
|||||||
Reference in New Issue
Block a user