File size: 1,406 Bytes
aacdea2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a4a3859
 
 
 
aacdea2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
56
57
58
FROM nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu22.04

ENV DEBIAN_FRONTEND=noninteractive \
    PYTHONUNBUFFERED=1 \
    PIP_NO_CACHE_DIR=1 \
    GRADIO_ANALYTICS_ENABLED=False \
    NVIDIA_VISIBLE_DEVICES=all \
    NVIDIA_DRIVER_CAPABILITIES=compute,utility

WORKDIR /app

RUN apt-get update && apt-get install -y --no-install-recommends \
    python3 \
    python3-dev \
    python3-pip \
    python-is-python3 \
    ffmpeg \
    libgl1 \
    libglib2.0-0 \
    libsm6 \
    libxext6 \
    libxrender1 \
    build-essential \
    && rm -rf /var/lib/apt/lists/*

COPY requirements-gpu.txt .
RUN python -m pip install --upgrade pip \
    && python -m pip install -r requirements-gpu.txt

RUN ln -sf /usr/local/cuda/targets/x86_64-linux/lib/libnvrtc.so.11.8.89 \
        /usr/local/cuda/targets/x86_64-linux/lib/libnvrtc.so \
    && ldconfig

COPY . .

RUN printf '%s\n' \
    'server_name: "0.0.0.0"' \
    'server_port: 7860' \
    'server_share: false' \
    'provider: cuda' \
    'force_cpu: false' \
    'max_threads: 1' \
    'memory_limit: 0' \
    'selected_theme: Default' \
    'output_image_format: png' \
    'output_video_format: mp4' \
    'output_video_codec: libx264' \
    'video_quality: 14' \
    'clear_output: false' \
    'live_cam_start_active: false' \
    'output_template: "{file}_{time}"' \
    'use_os_temp_folder: false' \
    > config.yaml

EXPOSE 7860

CMD ["python", "run.py"]