| |
| FROM nvidia/cuda:12.4.0-devel-ubuntu22.04 |
|
|
| |
| RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ |
| --mount=type=cache,target=/var/lib/apt,sharing=locked \ |
| apt-get update && apt-get install -y \ |
| python3.10 \ |
| python3.10-venv \ |
| python3.10-dev \ |
| python3-pip \ |
| git \ |
| build-essential \ |
| curl \ |
| ninja-build \ |
| wget |
|
|
| |
| RUN ln -sf /usr/bin/python3.10 /usr/bin/python3 && \ |
| ln -sf /usr/bin/python3.10 /usr/bin/python |
|
|
| |
| ENV CUDA_HOME=/usr/local/cuda \ |
| PATH=/usr/local/cuda/bin:$PATH \ |
| LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH |
|
|
| |
| COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv |
|
|
| |
| RUN useradd -m -u 1000 user |
| |
| |
| USER user |
| WORKDIR /home/user/app |
|
|
| |
| ENV HOME=/home/user \ |
| PATH=/home/user/.local/bin:$PATH \ |
| PYTHONUNBUFFERED=1 \ |
| GRADIO_SERVER_NAME=0.0.0.0 \ |
| GRADIO_SERVER_PORT=7860 \ |
| UV_CACHE_DIR=/home/user/.cache/uv |
|
|
| |
| COPY --chown=user pyproject.docker.toml ./pyproject.toml |
|
|
| |
| RUN mkdir -p wheels && \ |
| wget -O wheels/gsplat-0.1.0-cp310-cp310-linux_x86_64.whl \ |
| "https://huggingface.co/blanchon/image-gs-models-utils/resolve/main/gsplat-0.1.0-cp310-cp310-linux_x86_64.whl" |
|
|
| |
| RUN --mount=type=cache,target=/tmp/uv-cache,sharing=locked,uid=1000,gid=1000 \ |
| UV_CACHE_DIR=/tmp/uv-cache uv sync --no-dev |
|
|
| |
| COPY --chown=user . . |
|
|
| |
| EXPOSE 7860 |
|
|
| |
| CMD ["uv", "run", "python", "gradio_app.py"] |