diff --git a/Dockerfile b/Dockerfile index 247278ee..008269a1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -154,8 +154,10 @@ COPY s6-rc.d/ # NOTE(frank): I don't like this first line. However, the code in the dist/ folder of the plugins # isn't looking in the dist folder of the types. I think this is because we don't # bubble up index.ts files. + +COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/ RUN cd /app/worker.py && \ - pip install --no-cache-dir --upgrade pip setuptools && \ + uv pip install --system --no-cache-dir --upgrade pip setuptools && \ apt-get update && \ apt-get install -yqq --no-install-recommends lsb-release curl gpg && \ curl -fsSL https://deb.nodesource.com/setup_${NODE_VERSION_MAJOR}.x | bash - && \ @@ -173,7 +175,7 @@ RUN cd /app/worker.py echo "deb [arch=amd64,arm64,armhf] https://packages.microsoft.com/debian/12/prod bookworm main" > /etc/apt/sources.list.d/mssql-release.list && \ apt-get update && \ ACCEPT_EULA=Y apt-get install -y --no-install-recommends msodbcsql18 && \ - pip3 install --no-cache-dir -r ${REQUIREMENTS_FILE} && \ + uv pip install --system --no-cache-dir -r ${REQUIREMENTS_FILE} && \ rm -rf /var/lib/apt/lists/* && \ apt-get clean && \ find /app/orchestrator/bin /etc/s6-overlay/s6-rc.d -type d -exec chmod 755 {} \; && \ diff --git a/Dockerfile.worker.python b/Dockerfile.worker.python index 6a4ee33b..51584099 100644 --- a/Dockerfile.worker.python +++ b/Dockerfile.worker.python @@ -26,9 +26,10 @@ COPY ./workers/python/src/ /usr/app/worker-python/src/ # by write this file to disk, the import of this dependency will not log the creation of a file. COPY ./workers/python/canalyst.json /root/canalyst/keys.json + +COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/ RUN set -ex; \ - pip install --upgrade pip && \ - pip install --upgrade setuptools && \ + uv pip install --system --upgrade setuptools && \ groupadd --gid 1000 node && \ useradd --uid 1000 --gid node --shell /bin/bash --create-home node && \ apt-get update && \ @@ -39,7 +40,7 @@ RUN set -ex; \ apt-get update && \ ACCEPT_EULA=Y apt-get install -y msodbcsql18 ${EXTRA_DEBIAN_PACKAGES} && \ rm -rf /var/lib/apt/lists/* && \ - pip3 install -r requirements.txt && \ + uv pip install --system -r requirements.txt && \ chmod -R u=rwx,go=rx /usr/app/worker-python # this will fail if theres a dif diff --git a/workers/python/Dockerfile.freeze b/workers/python/Dockerfile.freeze index 0a05ca1f..21c06488 100644 --- a/workers/python/Dockerfile.freeze +++ b/workers/python/Dockerfile.freeze @@ -7,14 +7,14 @@ RUN apt-get update && apt-get install -y cmake libblas-dev liblapack-dev && pyth # install existing deps COPY requirements.txt . -RUN python -m pip install --upgrade pip -RUN python -m pip install --no-cache-dir -r requirements.txt +COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/ +RUN uv pip install --system --no-cache-dir -r requirements.txt # argument for additional dependency ARG ADDITIONAL_DEP # run additional install -RUN python -m pip install --no-cache-dir ${ADDITIONAL_DEP} +RUN uv pip install --system --no-cache-dir ${ADDITIONAL_DEP} # update requirements file RUN pip freeze > requirements.txt