sem6688 commited on
Commit
e701aeb
·
verified ·
1 Parent(s): c31d585
Files changed (1) hide show
  1. Dockerfile +10 -9
Dockerfile CHANGED
@@ -1,31 +1,32 @@
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
 
 
25
  ENV DATA_DIR=/tmp/data
26
  ENV LOG_FILE_ENABLED=false
27
  ENV LOG_LEVEL=INFO
28
 
29
  EXPOSE 7860
30
 
 
31
  CMD ["/app/entrypoint.sh"]
 
 
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"]