Spaces:
Sleeping
Sleeping
feat: 去除Dockerfile中的环境变量,统一使用config.json配置 (#601)
Browse files* feat: using config.json in docker mode
* 去除docker启动时的apikey要求
---------
Co-authored-by: MZhao <70903329+MZhao-ouo@users.noreply.github.com>
- Dockerfile +0 -1
- modules/config.py +0 -11
Dockerfile
CHANGED
@@ -11,6 +11,5 @@ COPY --from=builder /root/.local /root/.local
|
|
11 |
ENV PATH=/root/.local/bin:$PATH
|
12 |
COPY . /app
|
13 |
WORKDIR /app
|
14 |
-
ENV my_api_key empty
|
15 |
ENV dockerrun yes
|
16 |
CMD ["python3", "-u", "ChuanhuChatbot.py", "2>&1", "|", "tee", "/var/log/application.log"]
|
|
|
11 |
ENV PATH=/root/.local/bin:$PATH
|
12 |
COPY . /app
|
13 |
WORKDIR /app
|
|
|
14 |
ENV dockerrun yes
|
15 |
CMD ["python3", "-u", "ChuanhuChatbot.py", "2>&1", "|", "tee", "/var/log/application.log"]
|
modules/config.py
CHANGED
@@ -81,17 +81,6 @@ api_host = os.environ.get("api_host", config.get("api_host", ""))
|
|
81 |
if api_host:
|
82 |
shared.state.set_api_host(api_host)
|
83 |
|
84 |
-
if dockerflag:
|
85 |
-
if my_api_key == "empty":
|
86 |
-
logging.error("Please give a api key!")
|
87 |
-
sys.exit(1)
|
88 |
-
# auth
|
89 |
-
username = os.environ.get("USERNAME")
|
90 |
-
password = os.environ.get("PASSWORD")
|
91 |
-
if not (isinstance(username, type(None)) or isinstance(password, type(None))):
|
92 |
-
auth_list.append((os.environ.get("USERNAME"), os.environ.get("PASSWORD")))
|
93 |
-
authflag = True
|
94 |
-
|
95 |
@contextmanager
|
96 |
def retrieve_openai_api(api_key = None):
|
97 |
old_api_key = os.environ.get("OPENAI_API_KEY", "")
|
|
|
81 |
if api_host:
|
82 |
shared.state.set_api_host(api_host)
|
83 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
@contextmanager
|
85 |
def retrieve_openai_api(api_key = None):
|
86 |
old_api_key = os.environ.get("OPENAI_API_KEY", "")
|