Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- 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 |
-
#
|
| 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 |
-
#
|
| 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 |
-
#
|
| 21 |
EXPOSE 7860
|
| 22 |
|
| 23 |
-
#
|
| 24 |
-
CMD ["python", "-m", "
|
|
|
|
| 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"]
|