File size: 1,418 Bytes
d92a5dd
 
4865ddd
 
 
 
d92a5dd
 
 
 
 
 
 
 
 
e9da68d
d92a5dd
 
4865ddd
2fc8ed5
682509d
 
0ecf919
 
 
 
 
 
2fc8ed5
d92a5dd
be18414
 
 
 
 
e9da68d
 
a263f10
e9da68d
0ecf919
4865ddd
4f7138f
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
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"]