javaeeduke commited on
Commit
77482f9
·
verified ·
1 Parent(s): 5821e28

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -7
Dockerfile CHANGED
@@ -9,14 +9,16 @@ RUN git clone https://github.com/Panniantong/agent-reach.git /opt/agent-reach
9
  # 使用 --system 允许在 Docker 根环境下直接通过 pip 强行安装,跳过 Hatchling 的重复文件检查限制
10
  RUN pip install -e /opt/agent-reach
11
 
12
- # 如果项目需要初始化环境,再执行它指令
13
- # RUN agent-reach install --env=auto
14
- # 1. 声明 Hugging Face 必须的 7860 端口
15
- EXPOSE 7860
16
 
17
- # 2. 放开安装目录权限,防止 HF 的普通用户(UID 1000)无权限读写
18
  RUN chmod -R 777 /opt/agent-reach
19
 
20
- # 3. 强行让服务绑定到 0.0.0.0:7860 运行(假设它底层由 uvicorn 或 mcp 服务驱动)
21
- # 如果项目提供了内置启动入口,我们用 python 强行拉起服务并纠正 IP 和端口:
 
 
22
  CMD ["python", "-m", "uvicorn", "agent_reach.main:app", "--host", "0.0.0.0", "--port", "7860"]
 
9
  # 使用 --system 允许在 Docker 根环境下直接通过 pip 强行安装,跳过 Hatchling 的重复文件检查限制
10
  RUN pip install -e /opt/agent-reach
11
 
12
+ # 之前 git clone 和 pip install -e 分保持不变...
13
+
14
+ # 1. 显式安装 uvicorn fastapi (确保它能被拉起)
15
+ RUN pip install --no-cache-dir uvicorn fastapi
16
 
17
+ # 2. 放开安装目录权限
18
  RUN chmod -R 777 /opt/agent-reach
19
 
20
+ # 3. 声明端口
21
+ EXPOSE 7860
22
+
23
+ # 4. 启动服务
24
  CMD ["python", "-m", "uvicorn", "agent_reach.main:app", "--host", "0.0.0.0", "--port", "7860"]