Use system Python in Dockerfile instead of venv

This commit is contained in:
Fam Zheng 2025-11-24 07:38:34 +08:00
parent 7580a9a452
commit 9cc0df405c
2 changed files with 3 additions and 7 deletions

View File

@ -16,10 +16,9 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-ins
zip \ zip \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
ADD requirements.txt requirements.txt ADD requirements.txt requirements.txt
RUN python3 -m venv /venv && \ RUN rm -f /usr/lib/python*/EXTERNALLY-MANAGED && \
/venv/bin/pip install uv --index-url https://pypi.tuna.tsinghua.edu.cn/simple && \ pip3 install uv --index-url https://pypi.tuna.tsinghua.edu.cn/simple && \
rm -f /usr/lib/python*/EXTERNALLY-MANAGED && \ uv pip install --system --no-cache -r requirements.txt --default-index https://pypi.tuna.tsinghua.edu.cn/simple
/venv/bin/uv pip install --system --no-cache -r requirements.txt --default-index https://pypi.tuna.tsinghua.edu.cn/simple
ADD scripts/download_models.py /tmp/download_models.py ADD scripts/download_models.py /tmp/download_models.py
RUN HF_ENDPOINT=https://hf-mirror.com python3 /tmp/download_models.py && rm /tmp/download_models.py RUN HF_ENDPOINT=https://hf-mirror.com python3 /tmp/download_models.py && rm /tmp/download_models.py
ADD api /emblem/api ADD api /emblem/api

View File

@ -1,6 +1,3 @@
Flask>=3.0.3,<4.0.0
six>=1.16.0,<2.0.0
aliyun-python-sdk-core-v3
oss2 oss2
django-cors-headers django-cors-headers
django-tastypie django-tastypie