Spaces:
Paused
Paused
| # ============================================================================= | |
| # DOCKERFILE - ADUC-SDR: AI Video Suite v4.1.0 | |
| # Base: CUDA 12.8.0 | PyTorch 2.8.0+cu121 | |
| # Otimizado para Hugging Face Spaces com 8x NVIDIA L40S GPUs | |
| # ============================================================================= | |
| # Base CUDA 12.8.0 | |
| FROM nvidia/cuda:12.8.0-devel-ubuntu22.04 | |
| # ============================================================================= | |
| # METADADOS | |
| # ============================================================================= | |
| LABEL maintainer="Carlos Rodrigues dos Santos & Development Partner" | |
| LABEL description="ADUC-SDR: Production-Ready Multi-GPU AI Video Generation Suite with Wan2.2, SeedVR, LTX, MMAudio" | |
| LABEL version="4.1.0" | |
| LABEL cuda_version="12.8.0" | |
| LABEL python_version="3.10" | |
| # A wheel do PyTorch é compilada contra o CUDA Toolkit 12.1, mas é 100% compatível | |
| # com o driver mais recente (12.8) presente na imagem base. | |
| LABEL pytorch_version="2.8.0+cu121" | |
| LABEL gpu_optimized_for="8x_NVIDIA_L40S" | |
| # ============================================================================= | |
| # VARIÁVEIS DE AMBIENTE GLOBAIS | |
| # ============================================================================= | |
| ENV DEBIAN_FRONTEND=noninteractive | |
| ENV TZ=UTC | |
| ENV LANG=C.UTF-8 | |
| ENV LC_ALL=C.UTF-8 | |
| ENV PYTHONUNBUFFERED=1 | |
| ENV PYTHONDONTWRITEBYTECODE=1 | |
| ENV PIP_NO_CACHE_DIR=1 | |
| ENV PIP_DISABLE_PIP_VERSION_CHECK=1 | |
| # Otimizações de CUDA e Build | |
| ENV NVIDIA_VISIBLE_DEVICES=all | |
| ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility | |
| ENV TORCH_CUDA_ARCH_LIST="8.9" | |
| ENV MAX_JOBS=90 | |
| # Caminhos da Aplicação | |
| ENV APP_HOME=/app | |
| WORKDIR $APP_HOME | |
| # ============================================================================= | |
| # PACOTES DO SISTEMA E PYTHON 3.10 | |
| # ============================================================================= | |
| RUN apt-get update && \ | |
| apt-get install -y --no-install-recommends \ | |
| build-essential cmake git git-lfs curl wget ffmpeg ninja-build \ | |
| python3.10 python3.10-dev python3.10-distutils python3-pip \ | |
| && apt-get clean && rm -rf /var/lib/apt/lists/* | |
| RUN ln -sf /usr/bin/python3.10 /usr/bin/python3 && \ | |
| ln -sf /usr/bin/python3.10 /usr/bin/python && \ | |
| python3 -m pip install --upgrade pip | |
| # ============================================================================= | |
| # INSTALAÇÃO DE BIBLIOTECAS DE ALTA PERFORMANCE | |
| # ============================================================================= | |
| # 1. Instala PyTorch 2.8.0 e ferramentas de build | |
| RUN pip install \ | |
| torch==2.8.0 torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121 \ | |
| packaging wheel ninja setuptools | |
| # 2. Instala a wheel pré-compilada do Flash Attention 2.8.0 | |
| # Esta é a forma mais rápida e estável de instalar, evitando compilação demorada. | |
| # Esta wheel é compatível com PyTorch 2.8.0 e CUDA 12.x | |
| RUN pip install https://github.com/Dao-AILab/flash-attention/releases/download/v2.5.8/flash_attn-2.5.8+cu122torch2.3.0cxx11abiFALSE-cp310-cp310-linux_x86_64.whl | |
| # 3. Compila e instala o NVIDIA Apex | |
| RUN git clone https://github.com/NVIDIA/apex.git && \ | |
| cd apex && \ | |
| pip install -v --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" ./ && \ | |
| cd .. && rm -rf apex | |
| # 4. Instala os Kernels customizados do LTX | |
| RUN pip install --no-build-isolation git+https://github.com/Lightricks/LTX-Video-Q8-Kernels.git | |
| # ============================================================================= | |
| # INSTALAÇÃO DO RESTANTE DAS DEPENDÊNCIAS | |
| # ============================================================================= | |
| COPY requirements.txt . | |
| # Instala os pacotes restantes do requirements.txt | |
| # A linha do flash-attention no arquivo será ignorada se já estiver instalado, mas é bom limpá-la. | |
| RUN pip install -r requirements.txt | |
| # ============================================================================= | |
| # CLONAGEM E INSTALAÇÃO DOS REPOSITÓRIOS DA APLICAÇÃO | |
| # ============================================================================= | |
| RUN git clone https://github.com/Lightricks/LTX-Video.git && cd LTX-Video && pip install -e .[inference] | |
| RUN git clone https://github.com/Wan-Video/Wan2.2.git && cd Wan2.2 && pip install -r requirements.txt && pip install -r requirements_s2v.txt | |
| RUN git clone https://github.com/bytedance-seed/SeedVR.git && cd SeedVR && pip install -r requirements.txt | |
| RUN git clone https://github.com/hkchengrex/MMAudio.git && cd MMAudio && pip install -e . | |
| # ============================================================================= | |
| # COPIA O CÓDIGO DA APLICAÇÃO E CONFIGURA PERMISSÕES | |
| # ============================================================================= | |
| COPY . . | |
| RUN useradd -m -u 1000 -s /bash appuser && \ | |
| chown -R appuser:appuser $APP_HOME && \ | |
| mkdir -p /app/deformes_workspace && chown -R appuser:appuser /app/deformes_workspace | |
| USER appuser | |
| # ============================================================================= | |
| # PONTO DE ENTRADA | |
| # ============================================================================= | |
| RUN chmod +x start.sh | |
| ENTRYPOINT ["./start.sh"] | |
| CMD ["gradio"] |