Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit 660bb85

Browse files
committed
update torch docker image.
1 parent 2ca7816 commit 660bb85

File tree

1 file changed

+7
-26
lines changed

1 file changed

+7
-26
lines changed

docs/guides/python/ai-podcast-part-1.mdx

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -492,26 +492,10 @@ WORKDIR /app
492492
RUN --mount=type=cache,target=/root/.cache/uv \
493493
--mount=type=bind,source=uv.lock,target=uv.lock \
494494
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
495-
uv sync --frozen --no-install-project --extras ml --no-dev --no-python-downloads
495+
uv sync --frozen -v --no-install-project --extra ml --no-dev --no-python-downloads
496496
COPY . /app
497497
RUN --mount=type=cache,target=/root/.cache/uv \
498-
uv sync --frozen --no-dev --extras ml --no-python-downloads
499-
500-
# Then, use a final image without uv
501-
FROM python:3.11-slim-bookworm
502-
503-
ARG HANDLER
504-
ENV HANDLER=${HANDLER} PYTHONPATH=.
505-
506-
# Copy the application from the builder
507-
COPY --from=builder --chown=app:app /app /app
508-
WORKDIR /app
509-
510-
# Place executables in the environment at the front of the path
511-
ENV PATH="/app/.venv/bin:$PATH"
512-
513-
# Run the service using the path to the handler
514-
ENTRYPOINT /app/.venv/bin/python -u $HANDLER
498+
uv sync --frozen -v --no-dev --extra ml --no-python-downloads
515499

516500
# Torch dockerfile
517501
# Used for torch runtime based nitric batch services
@@ -527,14 +511,11 @@ ENV NVIDIA_DRIVER_CAPABILITIES=all
527511
ENV NVIDIA_REQUIRE_CUDA="cuda>=8.0"
528512

529513
RUN apt-get update -y && \
530-
apt-get install -y ca-certificates curl git python3.11 && \
531-
update-ca-certificates && \
532-
curl https://bootstrap.pypa.io/get-pip.py | python3.11 && \
533-
ln -sf /usr/bin/python3.11 /usr/local/bin/python && \
534-
ln -sf /usr/bin/python3.11 /usr/bin/python3 && \
535-
ln -sf /usr/bin/python3.11 /usr/bin/python && \
536-
ln -sf /usr/bin/pip3.11 /usr/bin/pip3 && \
537-
ln -sf /usr/bin/pip3.11 /usr/bin/pip
514+
apt-get install -y software-properties-common && \
515+
add-apt-repository ppa:deadsnakes/ppa && \
516+
apt-get update -y && \
517+
apt-get install -y python3.11 && \
518+
ln -sf /usr/bin/python3.11 /usr/local/bin/python3.11
538519

539520
# Copy the application from the builder
540521
COPY --from=builder --chown=app:app /app /app

0 commit comments

Comments
 (0)