Spaces:
Runtime error
Runtime error
| FROM nvidia/cuda:11.8.0-cudnn8-devel-ubuntu22.04 as base | |
| ARG FACEFUSION_VERSION=2.2.1 | |
| SHELL ["/bin/bash", "-o", "pipefail", "-c"] | |
| ENV DEBIAN_FRONTEND=noninteractive \ | |
| PYTHONUNBUFFERED=1 \ | |
| PIP_NO_CACHE_DIR=on \ | |
| SHELL=/bin/bash | |
| # Create workspace working directory | |
| WORKDIR / | |
| # Install Ubuntu packages | |
| RUN apt update && \ | |
| apt -y upgrade && \ | |
| apt install -y --no-install-recommends \ | |
| software-properties-common \ | |
| build-essential \ | |
| python3.10-venv \ | |
| python3-pip \ | |
| python3-tk \ | |
| python3-dev \ | |
| bash \ | |
| dos2unix \ | |
| git \ | |
| ncdu \ | |
| net-tools \ | |
| openssh-server \ | |
| libglib2.0-0 \ | |
| libsm6 \ | |
| libgl1 \ | |
| libxrender1 \ | |
| libxext6 \ | |
| ffmpeg \ | |
| wget \ | |
| curl \ | |
| psmisc \ | |
| rsync \ | |
| vim \ | |
| zip \ | |
| unzip \ | |
| htop \ | |
| screen \ | |
| tmux \ | |
| pkg-config \ | |
| libcairo2-dev \ | |
| libgoogle-perftools4 \ | |
| libtcmalloc-minimal4 \ | |
| apt-transport-https \ | |
| ca-certificates && \ | |
| update-ca-certificates && \ | |
| apt clean && \ | |
| rm -rf /var/lib/apt/lists/* && \ | |
| echo "en_US.UTF-8 UTF-8" > /etc/locale.gen | |
| # Set Python | |
| RUN ln -s /usr/bin/python3.10 /usr/bin/python | |
| # Stage 2: Install FaceFusion and python modules | |
| FROM base as setup | |
| # Create and use the Python venv | |
| RUN python3 -m venv /venv | |
| # Clone the git repo of FaceFusion and set version | |
| WORKDIR / | |
| RUN git clone https://github.com/facefusion/facefusion.git && \ | |
| cd /facefusion && \ | |
| git checkout ${FACEFUSION_VERSION} | |
| # Install the dependencies for FaceFusion | |
| WORKDIR /facefusion | |
| RUN source /venv/bin/activate && \ | |
| pip3 install -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cu118 && \ | |
| pip3 uninstall -y onnxruntime && \ | |
| pip3 install onnxruntime-gpu && \ | |
| deactivate | |
| # Install Jupyter and other tools | |
| RUN pip3 install -U --no-cache-dir jupyterlab \ | |
| jupyterlab_widgets \ | |
| ipykernel \ | |
| ipywidgets \ | |
| gdown | |
| # Install rclone | |
| RUN curl https://rclone.org/install.sh | bash | |
| # Install runpodctl | |
| RUN wget https://github.com/runpod/runpodctl/releases/download/v1.10.0/runpodctl-linux-amd -O runpodctl && \ | |
| chmod a+x runpodctl && \ | |
| mv runpodctl /usr/local/bin | |
| # Install croc | |
| RUN curl https://getcroc.schollz.com | bash | |
| # Clean up SSH host keys | |
| RUN rm -f /etc/ssh/ssh_host_* | |
| # Set up the container startup script | |
| WORKDIR / | |
| # Copy the scripts | |
| # Ensure your scripts are in the `scripts` directory and set permissions as needed | |
| # COPY --chmod=755 scripts/* ./ | |
| # Note: The actual scripts need to be provided by you, the user | |
| ENV TEMPLATE_VERSION=2.2.2 | |
| SHELL ["/bin/bash", "--login", "-c"] | |
| ENTRYPOINT [ "/start.sh" ] | |
| # Ensure `/start.sh` is provided and executable | |