sem6688 commited on
Commit
87996d0
·
verified ·
1 Parent(s): e701aeb
Files changed (1) hide show
  1. Dockerfile +6 -9
Dockerfile CHANGED
@@ -1,32 +1,29 @@
1
  FROM python:3.12-slim
2
 
3
- # 安装系统依赖
4
  RUN apt-get update && apt-get install -y git curl && rm -rf /var/lib/apt/lists/*
5
-
6
- # 安装 uv
7
  RUN pip install uv --no-cache-dir
8
 
9
- # 核心操作:指定克隆 v1.5.0 标签的
10
  RUN git clone --branch v1.5.0 https://github.com/chenyme/grok2api /app
11
 
12
  WORKDIR /app
13
 
14
- # 安装依赖
15
  RUN uv sync
16
 
17
- # 创建持久化目录
 
 
 
18
  RUN mkdir -p /tmp/data /tmp/logs
19
 
20
- # 复制脚本
21
  COPY entrypoint.sh /app/entrypoint.sh
22
  RUN chmod +x /app/entrypoint.sh
23
 
24
- # 设置环境变量
25
  ENV DATA_DIR=/tmp/data
26
  ENV LOG_FILE_ENABLED=false
27
  ENV LOG_LEVEL=INFO
28
 
29
  EXPOSE 7860
30
 
31
- # 启动
32
  CMD ["/app/entrypoint.sh"]
 
1
  FROM python:3.12-slim
2
 
 
3
  RUN apt-get update && apt-get install -y git curl && rm -rf /var/lib/apt/lists/*
 
 
4
  RUN pip install uv --no-cache-dir
5
 
6
+ # 克隆 v1.5.0 稳定
7
  RUN git clone --branch v1.5.0 https://github.com/chenyme/grok2api /app
8
 
9
  WORKDIR /app
10
 
11
+ # 安装项目依赖
12
  RUN uv sync
13
 
14
+ # --- 核心修复:显式安装 granian 确保命令存在 ---
15
+ RUN uv pip install granian
16
+ # --------------------------------------------
17
+
18
  RUN mkdir -p /tmp/data /tmp/logs
19
 
 
20
  COPY entrypoint.sh /app/entrypoint.sh
21
  RUN chmod +x /app/entrypoint.sh
22
 
 
23
  ENV DATA_DIR=/tmp/data
24
  ENV LOG_FILE_ENABLED=false
25
  ENV LOG_LEVEL=INFO
26
 
27
  EXPOSE 7860
28
 
 
29
  CMD ["/app/entrypoint.sh"]