File tree Expand file tree Collapse file tree 3 files changed +83
-23
lines changed
Expand file tree Collapse file tree 3 files changed +83
-23
lines changed Original file line number Diff line number Diff line change 1- # 使用官方 Python 基础镜像
2- FROM python:3.11-slim-bookworm AS builder
3-
4- # 安装 uv
5- COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
6-
7- # 设置工作目录
8- WORKDIR /app
9-
10- # 复制依赖文件
11- COPY pyproject.toml uv.lock ./
12-
13- # 导出依赖并安装到系统路径(或使用虚拟环境)
14- # --system 标志允许直接安装在镜像的 Python 环境中,适合容器场景
15- RUN uv sync --frozen --no-dev
16-
17- # 最终镜像
181FROM python:3.11-slim-bookworm
192
203WORKDIR /app
214
22- # 从构建阶段复制安装好的库
23- COPY --from=builder /usr/local/lib/python3.11/site-packages /usr/local/lib/python3.11/site-packages
24- COPY --from=builder /usr/local/bin /usr/local/bin
25-
265# 复制源代码
276COPY . .
7+ uv install -i https://mirrors.aliyun.com/pypi/simple/ --no-cache-dir .
288
299# 暴露端口
3010EXPOSE 8000
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ name = "dashscope-sdk-python"
33version = " 0.1.0"
44description = " Add your description here"
55readme = " README.md"
6- requires-python = " >=3.13 "
6+ requires-python = " >=3.11 "
77dependencies = [
88 " fastapi>=0.128.0" ,
99 " openai>=2.14.0" ,
You can’t perform that action at this time.
0 commit comments