Spaces:
Paused
Paused
FROM nvidia/cuda:11.3.1-cudnn8-devel-ubuntu18.04 | |
ENV DEBIAN_FRONTEND=noninteractive \ | |
TZ=America/Los_Angeles | |
ARG USE_PERSISTENT_DATA | |
RUN apt-get update && apt-get install -y \ | |
pkg-config libglvnd0 libgl1 libglx0 libegl1 libgles2 libglvnd-dev libgl1-mesa-dev libegl1-mesa-dev libgles2-mesa-dev cmake curl\ | |
git libc-bin libc6 \ | |
make build-essential libssl-dev zlib1g-dev \ | |
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \ | |
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev git-lfs gpg \ | |
ffmpeg libsm6 libxext6 cmake libgl1-mesa-glx xvfb \ | |
zsh sudo vim && rm -rf /var/lib/apt/lists/* && git lfs install | |
WORKDIR /code | |
COPY ./requirements.txt /code/requirements.txt | |
# User | |
RUN useradd -m -u 1000 user | |
USER user | |
ENV HOME=/home/user \ | |
PATH=/home/user/.local/bin:$PATH | |
# Pyenv | |
RUN curl https://pyenv.run | bash | |
ENV PATH=$HOME/.pyenv/shims:$HOME/.pyenv/bin:$PATH | |
ARG PYTHON_VERSION=3.10.13 | |
# Python | |
RUN pyenv install $PYTHON_VERSION && \ | |
pyenv global $PYTHON_VERSION && \ | |
pyenv rehash && \ | |
pip install --no-cache-dir --upgrade pip setuptools wheel && \ | |
pip install --no-cache-dir \ | |
datasets \ | |
huggingface-hub "protobuf<4" "click<8.1" && \ | |
pip install --upgrade pip && \ | |
pip install torch==2.0.1+cu118 torchvision==0.15.2+cu118 -f https://download.pytorch.org/whl/cu118/torch_stable.html | |
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt | |
# Set the working directory to /data if USE_PERSISTENT_DATA is set, otherwise set to $HOME/app | |
WORKDIR $HOME/app | |
# Copy the current directory contents into the container at $HOME/app setting the owner to the user | |
RUN git clone https://github.com/dreamgaussian/dreamgaussian . && \ | |
git clone --recursive https://github.com/ashawkey/diff-gaussian-rasterization && \ | |
pip install -r requirements.txt && \ | |
pip install -e git+https://github.com/NVlabs/nvdiffrast.git@main#egg=nvdiffrast && \ | |
pip install -e git+https://github.com/ashawkey/kiuikit.git@main#egg=kiui | |
USER user | |
# Set home to the user's home directory | |
ENV HOME=/home/user \ | |
PATH=/home/user/.local/bin:$PATH \ | |
PYTHONPATH=$HOME/app \ | |
PYTHONUNBUFFERED=1 \ | |
GRADIO_ALLOW_FLAGGING=never \ | |
GRADIO_SERVER_NAME=0.0.0.0 \ | |
SYSTEM=spaces | |
# Copy the current directory contents into the container at $HOME/app setting the owner to the user | |
COPY --chown=user . $HOME/app | |
CMD ["python3", "app.py"] |