Yukuiii commited on
Commit
c148ea0
·
1 Parent(s): 8b2e7a9

fix: 修复找不到config.json

Browse files
Files changed (2) hide show
  1. Dockerfile +2 -2
  2. app.py +2 -2
Dockerfile CHANGED
@@ -24,6 +24,6 @@ RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements_free
24
 
25
  COPY . .
26
 
27
- EXPOSE 5001
28
 
29
- CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:5001", "app:app"]
 
24
 
25
  COPY . .
26
 
27
+ EXPOSE 7860
28
 
29
+ CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:7860", "app:app"]
app.py CHANGED
@@ -52,8 +52,8 @@ active_accounts = set()
52
  # -------------------------------------------------------------------
53
  # (1) 配置文件的读写函数
54
  # -------------------------------------------------------------------
55
- CONFIG_PATH = "config.json"
56
-
57
  def load_config():
58
  """从 config.json 加载配置,出错则返回空 dict"""
59
  try:
 
52
  # -------------------------------------------------------------------
53
  # (1) 配置文件的读写函数
54
  # -------------------------------------------------------------------
55
+ current_dir = os.path.dirname(os.path.abspath(__file__)) # 新增路径计算
56
+ CONFIG_PATH = os.path.join(current_dir, "config.json") # 修改为绝对路径
57
  def load_config():
58
  """从 config.json 加载配置,出错则返回空 dict"""
59
  try: