FROM docker.io/pytorch/pytorch:2.14.0-cuda13.2-cudnn9-runtime@sha256:773f5f0122b8d6413ff1e47559d98a3a22896434822e2d7752ba8d5b85a363d7
WORKDIR /opt/opendpd
# Apply Ubuntu security updates and remove build headers from the runtime.
# Containers use the host kernel; linux-libc-dev is an unused header package.
RUN apt-get update && apt-get upgrade -y && apt-get purge -y linux-libc-dev python3-pip python3-wheel binutils-common libctf-nobfd0 libsframe1 libc-dev-bin && rm -rf /var/lib/apt/lists/*
RUN uv pip install --system --break-system-packages --no-cache --upgrade 'setuptools>=83'
RUN uv venv --system-site-packages --python /usr/bin/python /opt/opendpd-runtime
ENV PATH="/opt/opendpd-runtime/bin:${PATH}"
RUN uv pip install --python /opt/opendpd-runtime --no-cache --upgrade pip setuptools wheel numpy scipy pandas matplotlib pillow tqdm rich 'pydantic>=2.5,<3' psutil
COPY pyproject.toml README.md arguments.py project.py models.py main.py ./
COPY opendpd ./opendpd
COPY backbones ./backbones
COPY modules ./modules
COPY steps ./steps
COPY utils ./utils
COPY quant ./quant
COPY datasets ./datasets
COPY dataset ./dataset
RUN pip install --no-cache-dir --no-deps --no-build-isolation . && chmod -R a-w /opt/opendpd
# No package installation is needed in an offline inference/training worker.
# Remove installers and their bundled dependencies after building the app.
RUN uv pip uninstall --python /opt/opendpd-runtime pip && uv pip uninstall --system --break-system-packages pip uv
USER 65532:65532
ENTRYPOINT ["python", "-m", "opendpd.web.gpu_container"]
