diff --git a/Dockerfile b/Dockerfile index 1b9eba7772..a064e01e60 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,11 +12,13 @@ RUN rm -f /etc/apt/apt.conf.d/docker-clean \ RUN --mount=type=cache,id=ragflow_base_apt,target=/var/cache/apt,sharing=locked \ apt update && apt-get --no-install-recommends install -y ca-certificates -# if you located in China, you can use tsinghua mirror to speed up apt -RUN sed -i 's|http://archive.ubuntu.com|https://mirrors.tuna.tsinghua.edu.cn|g' /etc/apt/sources.list.d/ubuntu.sources +# If you are at mainland China, you can use tsinghua mirror to speed up apt and poetry +RUN sed -i 's|http://archive.ubuntu.com|https://mirrors.tuna.tsinghua.edu.cn|g' /etc/apt/sources.list.d/ubuntu.sources +ENV POETRY_PYPI_MIRROR_URL=https://pypi.tuna.tsinghua.edu.cn/simple/ RUN --mount=type=cache,id=ragflow_base_apt,target=/var/cache/apt,sharing=locked \ - apt update && apt install -y curl libpython3-dev nginx libglib2.0-0 libglx-mesa0 pkg-config libicu-dev libgdiplus python3-poetry \ + apt update && apt install -y curl libpython3-dev nginx libglib2.0-0 libglx-mesa0 pkg-config libicu-dev libgdiplus python3-pip python3-poetry \ + && pip3 install --user --break-system-packages poetry-plugin-pypi-mirror --index-url https://pypi.tuna.tsinghua.edu.cn/simple/ \ && rm -rf /var/lib/apt/lists/* RUN --mount=type=bind,source=openssl-1.1.1w.tar.gz,target=/root/openssl-1.1.1w.tar.gz \ diff --git a/Dockerfile.slim b/Dockerfile.slim index e91ef37903..d0430121d9 100644 --- a/Dockerfile.slim +++ b/Dockerfile.slim @@ -12,11 +12,13 @@ RUN rm -f /etc/apt/apt.conf.d/docker-clean \ RUN --mount=type=cache,id=ragflow_base_apt,target=/var/cache/apt,sharing=locked \ apt update && apt-get --no-install-recommends install -y ca-certificates -# if you located in China, you can use tsinghua mirror to speed up apt -RUN sed -i 's|http://archive.ubuntu.com|https://mirrors.tuna.tsinghua.edu.cn|g' /etc/apt/sources.list.d/ubuntu.sources +# If you are at mainland China, you can use tsinghua mirror to speed up apt and poetry +RUN sed -i 's|http://archive.ubuntu.com|https://mirrors.tuna.tsinghua.edu.cn|g' /etc/apt/sources.list.d/ubuntu.sources +ENV POETRY_PYPI_MIRROR_URL=https://pypi.tuna.tsinghua.edu.cn/simple/ RUN --mount=type=cache,id=ragflow_base_apt,target=/var/cache/apt,sharing=locked \ - apt update && apt install -y curl libpython3-dev nginx libglib2.0-0 libglx-mesa0 pkg-config libicu-dev libgdiplus python3-poetry \ + apt update && apt install -y curl libpython3-dev nginx libglib2.0-0 libglx-mesa0 pkg-config libicu-dev libgdiplus python3-pip python3-poetry \ + && pip3 install --user --break-system-packages poetry-plugin-pypi-mirror \ && rm -rf /var/lib/apt/lists/* RUN --mount=type=bind,source=openssl-1.1.1w.tar.gz,target=/root/openssl-1.1.1w.tar.gz \