|
|
@@ -1,23 +1,20 @@
|
|
|
# 使用官方 Python 3.10 slim 镜像
|
|
|
-FROM python:3.10-slim
|
|
|
+FROM registry.cn-hangzhou.aliyuncs.com/stuuudy/python:3.13-slim
|
|
|
|
|
|
# 设置工作目录
|
|
|
WORKDIR /app
|
|
|
|
|
|
-# 安装系统依赖(ODPS、SSL等)
|
|
|
-RUN apt-get update && apt-get install -y \
|
|
|
- gcc \
|
|
|
- g++ \
|
|
|
- libssl-dev \
|
|
|
- libffi-dev \
|
|
|
- curl \
|
|
|
+# 安装系统依赖(使用阿里云镜像源)
|
|
|
+RUN sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list.d/debian.sources \
|
|
|
+ && apt-get update \
|
|
|
+ && apt-get install -y --no-install-recommends curl \
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
# 复制依赖文件
|
|
|
COPY examples/auto_put_ad_mini/requirements.txt .
|
|
|
|
|
|
-# 安装 Python 依赖
|
|
|
-RUN pip install --no-cache-dir -r requirements.txt
|
|
|
+# 安装 Python 依赖(使用阿里云 PyPI 镜像)
|
|
|
+RUN pip install --no-cache-dir -i https://mirrors.aliyun.com/pypi/simple/ -r requirements.txt
|
|
|
|
|
|
# 复制 Agent 框架(从项目根目录)
|
|
|
COPY agent /app/agent
|
|
|
@@ -43,7 +40,7 @@ ENV PYTHONUNBUFFERED=1 \
|
|
|
EXPOSE 8080
|
|
|
|
|
|
# 健康检查(使用 FastAPI 端点,如果可用)
|
|
|
-HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
|
|
+HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
|
|
|
CMD curl -f http://localhost:8080/health || python -c "import pathlib; pathlib.Path('/app/outputs').exists()" || exit 1
|
|
|
|
|
|
# 默认命令:启动 FastAPI 服务器(而非单次执行)
|