fix:优化安装源

This commit is contained in:
丹尼尔
2026-03-11 11:04:16 +08:00
parent 846c65b155
commit 4a658a7331
3 changed files with 201 additions and 7 deletions

View File

@@ -26,7 +26,25 @@ COPY --from=build /app/dist ./dist
COPY --from=build /app/public ./public
COPY backend/requirements.txt ./backend/requirements.txt
RUN pip3 install --no-cache-dir --break-system-packages -r backend/requirements.txt
ARG PIP_INDEX="https://pypi.tuna.tsinghua.edu.cn/simple"
ARG PIP_TRUSTED_HOST="pypi.tuna.tsinghua.edu.cn"
RUN pip3 install --no-cache-dir --break-system-packages \
-i "${PIP_INDEX}" --trusted-host "${PIP_TRUSTED_HOST}" \
fastapi==0.115.0 && \
pip3 install --no-cache-dir --break-system-packages \
-i "${PIP_INDEX}" --trusted-host "${PIP_TRUSTED_HOST}" \
"uvicorn[standard]==0.30.0" && \
pip3 install --no-cache-dir --break-system-packages \
-i "${PIP_INDEX}" --trusted-host "${PIP_TRUSTED_HOST}" \
httpx==0.27.0 && \
pip3 install --no-cache-dir --break-system-packages \
-i "${PIP_INDEX}" --trusted-host "${PIP_TRUSTED_HOST}" \
"websockets>=12.0" && \
pip3 install --no-cache-dir --break-system-packages \
-i "${PIP_INDEX}" --trusted-host "${PIP_TRUSTED_HOST}" \
"openai>=1.0.0" && \
pip3 check && \
python3 -c "import fastapi; import uvicorn; import httpx; import websockets; import openai; print('all deps ok')"
COPY backend ./backend
COPY .env.example ./