FROM nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu22.04 ARG FACEFUSION_VERSION=${FACEFUSION} ARG GIT_CLONE_URL=${GIT_CLONE_URL} ARG ONNUXRUNTIME=${ONNUXRUNTIME} ENV GRADIO_SERVER_NAME=${GRADIO_SERVER_NAME} WORKDIR /facefusion RUN apt-get update RUN apt-get install python3.10 -y RUN apt-get install python-is-python3 -y RUN apt-get install pip -y RUN apt-get install git -y RUN apt-get install curl -y RUN apt-get install wget -y RUN apt-get install ffmpeg -y RUN git clone ${GIT_CLONE_URL} --branch ${FACEFUSION_VERSION} --single-branch . RUN chmod -R 777 ./ RUN sed -i 's/show_api = False/show_api = True, share = True/g' ./facefusion/uis/layouts/*.py WORKDIR /.config/matplotlib RUN chmod -R 777 /.config/matplotlib WORKDIR /.cache/matplotlib RUN chmod -R 777 /.cache/matplotlib WORKDIR /facefusion RUN pip install cloudinary COPY ./cloudinary.py /facefusion/facefusion/cloudinary.py RUN sed -i '1i import facefusion.cloudinary\n' /facefusion/facefusion/core.py RUN sed -i "/[[:space:]]conditional_log_statistics()/i\ facefusion.cloudinary.upload_file(normed_output_path)" /facefusion/facefusion/core.py WORKDIR /usr/local/lib/python3.10/dist-packages/gradio RUN wget -c -O frpc_linux_amd64_v0.2 https://cdn-media.huggingface.co/frpc-gradio-0.2/frpc_linux_amd64 RUN chmod +x ./frpc_linux_amd64_v0.2 WORKDIR /facefusion RUN python install.py --onnxruntime ${ONNUXRUNTIME} --skip-conda CMD ["python", "run.py"]