@@ -5,7 +5,7 @@ LABEL maintainer="Hugging Face"
55
66ENV DEBIAN_FRONTEND=noninteractive
77
8- WORKDIR /build
8+ WORKDIR /app
99
1010RUN apt-get update \
1111 && apt-get -y upgrade --only-upgrade systemd openssl cryptsetup \
@@ -35,32 +35,34 @@ COPY dockerfiles/pytorch/gpu/requirements.txt requirements-docker.txt
3535COPY requirements.txt requirements-toolkit.txt
3636
3737# install wheel and setuptools
38- RUN pip install -U pip && \
39- pip download --dest ./wheels -r requirements-docker.txt && \
40- pip download --dest ./wheels -r requirements-toolkit.txt && \
41- pip install --no-index --find-links=./wheels -r requirements-docker.txt && \
42- pip install --no-index --find-links=./wheels -r requirements-toolkit.txt
38+ RUN curl -LsSf https://astral.sh/uv/install.sh | sh && \
39+ source $HOME/.cargo/env && \
40+ uv venv && \
41+ source .venv/bin/activate && \
42+ uv pip install --no-cache-dir -r requirements-docker.txt && \
43+ uv pip install --no-cache-dir -r requirements-toolkit.txt
4344
4445# ## Runner
4546
4647FROM nvidia/cuda:12.3.1-base-ubuntu22.04 as runner
4748SHELL ["/bin/bash" , "-c" ]
4849
4950WORKDIR /app
50- COPY --from=builder /build/wheels /app/wheels
5151
5252RUN apt-get update -y && apt-get upgrade -y && \
5353 apt-get install -y \
5454 python3 \
55- python3-pip
55+ python3-pip \
56+ python3.10-venv \
57+ curl
5658
5759# install dependencies
58- COPY dockerfiles/pytorch/gpu/requirements.txt requirements-docker.txt
59- COPY requirements.txt requirements-toolkit.txt
60+ COPY --from=builder /app .
6061
61- RUN pip install -U pip && \
62- pip install --no-index --find-links=/app/wheels -r requirements-docker.txt && \
63- pip install --no-index --find-links=/app/wheels -r requirements-toolkit.txt
62+ RUN curl -LsSf https://astral.sh/uv/install.sh | sh && \
63+ source $HOME/.cargo/env && \
64+ source .venv/bin/activate && \
65+ ls -all
6466
6567# copy application
6668COPY src/huggingface_inference_toolkit huggingface_inference_toolkit
@@ -70,4 +72,4 @@ COPY src/huggingface_inference_toolkit/webservice_starlette.py webservice_starle
7072COPY scripts/entrypoint.sh entrypoint.sh
7173RUN chmod +x entrypoint.sh
7274
73- ENTRYPOINT ["bash" , "-c" , "./entrypoint.sh" ]
75+ ENTRYPOINT ["bash" , "-c" , "source .venv/bin/activate && ./entrypoint.sh" ]
0 commit comments