This reverts commit 68701dbb1d.
This commit is contained in:
jimmy-sketch
2025-07-24 20:23:26 +08:00
parent 68701dbb1d
commit 7b6f92593e
28 changed files with 1394 additions and 644 deletions

View File

@@ -1,6 +1,7 @@
FROM python:3.11-slim
FROM ghcr.io/astral-sh/uv:python3.11-bookworm-slim
WORKDIR /app
ENV UV_PROJECT_ENVIRONMENT venv
# 安装系统依赖
RUN apt-get update && apt-get install -y \
@@ -10,10 +11,11 @@ RUN apt-get update && apt-get install -y \
&& rm -rf /var/lib/apt/lists/*
# 复制依赖文件
COPY requirements.txt .
COPY uv.lock .
COPY pyproject.toml .
# 安装Python依赖
RUN pip install --no-cache-dir -r requirements.txt
RUN uv sync --locked
# 复制应用代码
COPY . .
@@ -22,4 +24,4 @@ COPY . .
EXPOSE 8000
# 启动命令
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
CMD ["uv", "run", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]