fix: Dockerfile 中先更新 uv.lock 再安装

This commit is contained in:
xiaozhu
2026-08-12 16:32:35 +08:00
parent 8d83adf1aa
commit 55e37b5a69
+2 -1
View File
@@ -5,7 +5,8 @@ COPY backend ./backend
COPY alembic.ini ./
COPY migrations ./migrations
COPY pyproject.toml uv.lock ./
RUN UV_DEFAULT_INDEX="https://pypi.tuna.tsinghua.edu.cn/simple/" uv sync --frozen --no-dev --no-editable --package backend
RUN UV_DEFAULT_INDEX="https://pypi.tuna.tsinghua.edu.cn/simple/" uv lock && \
UV_DEFAULT_INDEX="https://pypi.tuna.tsinghua.edu.cn/simple/" uv sync --frozen --no-dev --no-editable --package backend
EXPOSE 8000
CMD ["gunicorn", "--config", "backend/gunicorn.conf.py", "backend.main:app"]