Spaces:
Running
Running
Upload Dockerfile with huggingface_hub
Browse files- Dockerfile +25 -25
Dockerfile
CHANGED
|
@@ -1,25 +1,25 @@
|
|
| 1 |
-
FROM python:3.12
|
| 2 |
-
WORKDIR /app
|
| 3 |
-
|
| 4 |
-
RUN pip install --no-cache-dir --timeout 120 fastapi uvicorn requests pyyaml numpy httpx python-docx openpyxl python-pptx pdfplumber "xlrd==1.2.0" tavily-python ebooklib beautifulsoup4 mobi
|
| 5 |
-
RUN pip install --no-cache-dir --timeout 120 torch --index-url https://download.pytorch.org/whl/cpu
|
| 6 |
-
RUN pip install --no-cache-dir --timeout 120 sentence-transformers faiss-cpu
|
| 7 |
-
# llama-cpp-python 预编译 wheel(30 秒,不需编译)
|
| 8 |
-
RUN pip install --no-cache-dir --timeout 300 "llama-cpp-python>=0.3.4" \
|
| 9 |
-
--extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
|
| 10 |
-
|
| 11 |
-
# 模型在 app.py startup 时按需下载(避免每次代码变更重下 4GB)
|
| 12 |
-
# 全部源码、工具、配置 → 构建进镜像
|
| 13 |
-
COPY app.py /app/
|
| 14 |
-
COPY scripts /app/scripts/
|
| 15 |
-
COPY services /app/services/
|
| 16 |
-
COPY skills /app/skills/
|
| 17 |
-
|
| 18 |
-
# 自动拉取第三方技能(@ai install-skill 安装后自动进下次构建)
|
| 19 |
-
RUN git clone --depth 1 --single-branch https://github.com/hughyonng/OpenWolf.git /tmp/update \
|
| 20 |
-
&& cp -r /tmp/update/skills/third-party /app/skills/ 2>/dev/null || true \
|
| 21 |
-
&& cp -r /tmp/update/skills/library /app/skills/ 2>/dev/null || true \
|
| 22 |
-
&& rm -rf /tmp/update
|
| 23 |
-
|
| 24 |
-
EXPOSE 7860
|
| 25 |
-
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 1 |
+
FROM python:3.12
|
| 2 |
+
WORKDIR /app
|
| 3 |
+
|
| 4 |
+
RUN pip install --no-cache-dir --timeout 120 fastapi uvicorn requests pyyaml numpy httpx python-docx openpyxl python-pptx pdfplumber "xlrd==1.2.0" tavily-python ebooklib beautifulsoup4 mobi PyMuPDF
|
| 5 |
+
RUN pip install --no-cache-dir --timeout 120 torch --index-url https://download.pytorch.org/whl/cpu
|
| 6 |
+
RUN pip install --no-cache-dir --timeout 120 sentence-transformers faiss-cpu
|
| 7 |
+
# llama-cpp-python 预编译 wheel(30 秒,不需编译)
|
| 8 |
+
RUN pip install --no-cache-dir --timeout 300 "llama-cpp-python>=0.3.4" \
|
| 9 |
+
--extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
|
| 10 |
+
|
| 11 |
+
# 模型在 app.py startup 时按需下载(避免每次代码变更重下 4GB)
|
| 12 |
+
# 全部源码、工具、配置 → 构建进镜像
|
| 13 |
+
COPY app.py /app/
|
| 14 |
+
COPY scripts /app/scripts/
|
| 15 |
+
COPY services /app/services/
|
| 16 |
+
COPY skills /app/skills/
|
| 17 |
+
|
| 18 |
+
# 自动拉取第三方技能(@ai install-skill 安装后自动进下次构建)
|
| 19 |
+
RUN git clone --depth 1 --single-branch https://github.com/hughyonng/OpenWolf.git /tmp/update \
|
| 20 |
+
&& cp -r /tmp/update/skills/third-party /app/skills/ 2>/dev/null || true \
|
| 21 |
+
&& cp -r /tmp/update/skills/library /app/skills/ 2>/dev/null || true \
|
| 22 |
+
&& rm -rf /tmp/update
|
| 23 |
+
|
| 24 |
+
EXPOSE 7860
|
| 25 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|