mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-06-03 14:39:56 +08:00
feat(venv): add uv compatibility for pip commands and enhance virtual environment setup
This commit is contained in:
@@ -66,10 +66,18 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
# 安装 Python 构建依赖并创建虚拟环境
|
||||
WORKDIR /app
|
||||
COPY requirements.in requirements.in
|
||||
COPY scripts/uv-pip-compat.sh /usr/local/bin/uv-pip-compat
|
||||
RUN python3 -m venv ${VENV_PATH} \
|
||||
&& pip install --upgrade "pip" \
|
||||
&& pip install "Cython~=3.1.2" "pip-tools" \
|
||||
&& pip-compile requirements.in \
|
||||
&& env UV_INSTALL_DIR=/usr/local/bin sh -c "$(curl -LsSf https://astral.sh/uv/install.sh)" \
|
||||
&& chmod +x /usr/local/bin/uv-pip-compat \
|
||||
&& ln -sf /usr/local/bin/uv ${VENV_PATH}/bin/uv \
|
||||
&& ln -sf /usr/local/bin/uv-pip-compat ${VENV_PATH}/bin/pip \
|
||||
&& ln -sf /usr/local/bin/uv-pip-compat ${VENV_PATH}/bin/pip3 \
|
||||
&& ln -sf /usr/local/bin/uv-pip-compat ${VENV_PATH}/bin/pip3.12 \
|
||||
&& ln -sf /usr/local/bin/uv-pip-compat ${VENV_PATH}/bin/pip-compile \
|
||||
&& ln -sf /usr/local/bin/uv-pip-compat ${VENV_PATH}/bin/pip-sync \
|
||||
&& pip install "Cython~=3.1.2" \
|
||||
&& pip-compile requirements.in -o requirements.txt \
|
||||
&& pip install -r requirements.txt
|
||||
|
||||
# 下载准备代码
|
||||
@@ -98,6 +106,8 @@ ENV LD_PRELOAD="/usr/local/lib/libjemalloc.so"
|
||||
|
||||
# python 环境
|
||||
COPY --from=prepare_venv --chmod=777 ${VENV_PATH} ${VENV_PATH}
|
||||
COPY --from=prepare_venv /usr/local/bin/uv /usr/local/bin/uv
|
||||
COPY --from=prepare_venv /usr/local/bin/uv-pip-compat /usr/local/bin/uv-pip-compat
|
||||
|
||||
# playwright 环境
|
||||
RUN playwright install-deps chromium \
|
||||
|
||||
Reference in New Issue
Block a user