File size: 1,747 Bytes
ddefedb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7c8cefe
 
ddefedb
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
FROM nvidia/cuda:12.1.1-cudnn8-devel-ubuntu22.04

# Configure environment
ENV DEBIAN_FRONTEND=noninteractive

# Install the required packages
RUN apt-get update && apt-get install -y \
    software-properties-common

# Add the deadsnakes PPA
RUN add-apt-repository ppa:deadsnakes/ppa

# Install Python 3.10
RUN apt-get update && apt-get install -y \
    python3.10 \
    python3.10-dev \
    python3.10-distutils \
    python3.10-venv \
    python3-pip

# Install other dependencies
RUN apt-get install -y \
    git \
    gcc \
    g++ \
    libgl1 \
    libglib2.0.0 \
    ffmpeg \
    cmake \
    libgtk2.0.0

# Working directory
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH
WORKDIR $HOME/app

# Install the required Python packages
RUN pip install wheel
RUN pip install torch==2.1.0+cu121 torchvision==0.16.0+cu121 torchaudio==2.1.0+cu121 torchtext==0.16.0 torchdata==0.7.0 --extra-index-url https://download.pytorch.org/whl/cu121 -U
RUN sed -i 's/return caster.operator typename make_caster<T>::template cast_op_type<T>();/return caster;/' /home/user/.local/lib/python3.10/site-packages/torch/include/pybind11/cast.h
RUN pip install tyro kiui PyMCubes nerfacc trimesh pymeshlab ninja plyfile xatlas pygltflib gradio opencv-python scikit-learn
RUN pip install https://github.com/dylanebert/wheels/releases/download/1.0.0/diff_gaussian_rasterization-0.0.0-cp310-cp310-linux_x86_64.whl
RUN pip install https://github.com/dylanebert/wheels/releases/download/1.0.0/nvdiffrast-0.3.1-py3-none-any.whl
RUN pip install git+https://github.com/ashawkey/kiuikit.git

# Copy all files to the working directory
COPY --chown=user . $HOME/app

EXPOSE 7860

# Run the gradio app
CMD ["python3.10", "app.py"]