javaeeduke commited on
Commit
4a1969e
·
verified ·
1 Parent(s): 77482f9

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -13
Dockerfile CHANGED
@@ -1,24 +1,17 @@
1
  FROM docker.io/library/python:3.10
2
 
3
- # 安装基础依赖
4
  RUN pip install --no-cache-dir pipx && pipx ensurepath
5
 
6
- # 避坑核心:不直接安装 zip,而是克隆源码并用 editable 模式或直接源码安装
7
  RUN git clone https://github.com/Panniantong/agent-reach.git /opt/agent-reach
8
-
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"]
 
1
  FROM docker.io/library/python:3.10
2
 
3
+ # 1. 安装基础依赖
4
  RUN pip install --no-cache-dir pipx && pipx ensurepath
5
 
6
+ # 2. 克隆源码并进行源码安装
7
  RUN git clone https://github.com/Panniantong/agent-reach.git /opt/agent-reach
 
 
8
  RUN pip install -e /opt/agent-reach
9
 
10
+ # 3. 授予 Hugging Face 默认用户(UID 1000)完全的读写权限,防止后续报错
 
 
 
 
 
11
  RUN chmod -R 777 /opt/agent-reach
12
 
13
+ # 4. 声明 Hugging Face 必须的 7860 端口
14
  EXPOSE 7860
15
 
16
+ # 5. 【核心避坑】使用 Python 自带的轻量服务器强行占领 7860 端口,实现完美保活
17
+ CMD ["python", "-m", "http.server", "7860"]