refactor: integrate model platform backend

This commit is contained in:
Winnie
2026-07-30 13:43:29 +08:00
parent baee7a60e1
commit 6d6c70cea8
97 changed files with 19724 additions and 2146 deletions
+6 -14
View File
@@ -1,22 +1,14 @@
# backend/Dockerfile
FROM python:3.12-slim
FROM python:3.12-slim-bookworm
ENV PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1
WORKDIR /app
# 安装 uv
COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv
# 1. 拷贝根目录配置与 lock 文件
COPY pyproject.toml uv.lock ./
# 2. 拷贝 common 模块与 backend 模块
COPY common ./common
COPY backend ./backend
# 3. 安装 backend 及其所有依赖 (包括本地 common)
RUN UV_DEFAULT_INDEX="https://pypi.tuna.tsinghua.edu.cn/simple/" uv sync --frozen --no-dev --no-editable --package backend
COPY alembic.ini ./
COPY migrations ./migrations
RUN uv sync --frozen --no-dev --no-editable --package backend
EXPOSE 8000
# 4. 启动服务 (通过 uv run 指定运行 backend 包)
CMD ["uv", "run", "--package", "backend", "uvicorn", "backend.main:app", "--host", "0.0.0.0", "--port", "8000"]
CMD ["uv", "run", "--frozen", "--package", "backend", "uvicorn", "backend.main:app", "--host", "0.0.0.0", "--port", "8000"]