edit
Browse files- 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 |
-
#
|
| 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"]
|