sem6688 commited on
Commit
c31d585
·
verified ·
1 Parent(s): 75aacd8
Files changed (1) hide show
  1. Dockerfile +9 -4
Dockerfile CHANGED
@@ -1,19 +1,24 @@
 
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
-
5
  RUN pip install uv --no-cache-dir
6
 
7
- # clone /app 目录本身
8
- RUN git clone https://github.com/chenyme/grok2api /app
 
 
 
9
 
10
  WORKDIR /app
11
 
 
12
  RUN uv sync
13
 
14
-
15
  RUN mkdir -p /tmp/data /tmp/logs
16
 
 
17
  COPY entrypoint.sh /app/entrypoint.sh
18
  RUN chmod +x /app/entrypoint.sh
19
 
 
1
+ # 使用 3.12,因为老版本项目对 3.13 兼容性较差
2
  FROM python:3.12-slim
3
 
4
  RUN apt-get update && apt-get install -y git curl && rm -rf /var/lib/apt/lists/*
 
5
  RUN pip install uv --no-cache-dir
6
 
7
+ # 核心改动:克隆源码后,立即回退5 天前的稳定提交点
8
+ # 这个 commit 避开了最近几天的代码重构和导入 Bug
9
+ RUN git clone https://github.com/chenyme/grok2api /app && \
10
+ cd /app && \
11
+ git checkout `git rev-list -n 1 --before="2026-03-12" main`
12
 
13
  WORKDIR /app
14
 
15
+ # 安装依赖(此时的依赖文件是旧版的,不会包含报错的 curl_cffi)
16
  RUN uv sync
17
 
18
+ # 创建必要目录
19
  RUN mkdir -p /tmp/data /tmp/logs
20
 
21
+ # 复制你现有的脚本
22
  COPY entrypoint.sh /app/entrypoint.sh
23
  RUN chmod +x /app/entrypoint.sh
24