nbugs commited on
Commit
b1fe40a
·
verified ·
1 Parent(s): f9bcf0a

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -8
Dockerfile CHANGED
@@ -3,26 +3,27 @@ FROM python:3.11
3
  # 安装系统依赖
4
  RUN apt-get update && \
5
  apt-get install -y ca-certificates curl gnupg && \
6
- apt-get clean && \
7
  rm -rf /var/lib/apt/lists/*
8
 
9
  # 克隆DeepClaude仓库
10
  RUN git clone https://github.com/ErlichLiu/DeepClaude.git /app
11
  WORKDIR /app
12
 
13
- # 安装uv
14
- RUN pip install --upgrade pip && \
15
- pip install uv
16
 
17
- # 使用uv安装依赖
18
- RUN uv pip install --system -r requirements.txt || echo "如果没有requirements.txt,将执行uv sync" && \
19
- uv sync
 
20
 
21
  # 暴露Hugging Face默认端口
22
  EXPOSE 7860
23
 
24
  # 创建启动脚本
25
- RUN echo '#!/bin/bash\nuvicorn app.main:app --host 0.0.0 --port 7860' > /app/start.sh && \
26
  chmod +x /app/start.sh
27
 
28
  # 启动服务
 
3
  # 安装系统依赖
4
  RUN apt-get update && \
5
  apt-get install -y ca-certificates curl gnupg && \
6
+ apt-get clean && \
7
  rm -rf /var/lib/apt/lists/*
8
 
9
  # 克隆DeepClaude仓库
10
  RUN git clone https://github.com/ErlichLiu/DeepClaude.git /app
11
  WORKDIR /app
12
 
13
+ # 直接安装依赖(无需虚拟环境)
14
+ # 首先确保安装fastapi和uvicorn
15
+ RUN pip install --no-cache-dir fastapi uvicorn
16
 
17
+ # 如果仓库中有requirements.txt,则安装其中的依赖
18
+ RUN if [ -f requirements.txt ]; then \
19
+ pip install --no-cache-dir -r requirements.txt; \
20
+ fi
21
 
22
  # 暴露Hugging Face默认端口
23
  EXPOSE 7860
24
 
25
  # 创建启动脚本
26
+ RUN echo '#!/bin/bash\nuvicorn app.main:app --host 0.0 --port 7860' > /app/start.sh && \
27
  chmod +x /app/start.sh
28
 
29
  # 启动服务