Skip to content

Commit

Permalink
Make orthanc Dockerfile use uv
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyestein committed Dec 21, 2024
1 parent d94c35c commit 3dd2c9a
Showing 1 changed file with 20 additions and 19 deletions.
39 changes: 20 additions & 19 deletions docker/orthanc/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,28 @@ SHELL ["/bin/bash", "-o", "pipefail", "-e", "-u", "-x", "-c"]
# where you get a warning when installing system-wide packages.
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
apt-get install --yes --no-install-recommends python3-venv tzdata
RUN python3 -m venv /.venv
apt-get install --yes --no-install-recommends curl tzdata && \
apt-get autoremove --yes && apt-get clean --yes && rm -rf /var/lib/apt/lists/*

# Install curl for now, but try to remove this dependency
RUN apt-get --assume-yes install curl
# install uv
COPY --from=ghcr.io/astral-sh/uv:0.5.10 /uv /uvx /bin/

# Install requirements before copying modules
COPY ./pixl_core/pyproject.toml /pixl_core/pyproject.toml
COPY ./pixl_dcmd/pyproject.toml /pixl_dcmd/pyproject.toml

RUN --mount=type=cache,target=/root/.cache \
/.venv/bin/pip install pixl_core/ \
&& /.venv/bin/pip install pixl_dcmd/

COPY ./pixl_core/ /pixl_core
RUN --mount=type=cache,target=/root/.cache \
/.venv/bin/pip install --no-cache-dir --force-reinstall --no-deps ./pixl_core

COPY ./pixl_dcmd/ /pixl_dcmd
RUN --mount=type=cache,target=/root/.cache \
/.venv/bin/pip install --no-cache-dir --force-reinstall --no-deps ./pixl_dcmd
# Install our code
# The workspace project file
COPY pyproject.toml .
# All pyproject.toml files referenced by the root one must exist or uv will error
COPY ./pixl_imaging/pyproject.toml pixl_imaging/pyproject.toml
COPY ./pixl_export/pyproject.toml pixl_export/pyproject.toml
COPY ./cli/pyproject.toml cli/pyproject.toml
COPY ./hasher/pyproject.toml hasher/pyproject.toml
# prereqs for dcmd
COPY ./pytest-pixl/ pytest-pixl/
COPY ./pixl_core/ pixl_core/
COPY ./pixl_dcmd/ pixl_dcmd
RUN uv venv
# Need --no-editable so that our packages are in
# site-packages, so orthanc plugin manager can find them
RUN uv sync --no-editable --package pixl-dcmd

ARG ORTHANC_DIR
COPY ./orthanc/${ORTHANC_DIR}/plugin/pixl.py /etc/orthanc/pixl.py
Expand Down

0 comments on commit 3dd2c9a

Please sign in to comment.