Update Dockerfile
Browse files12345678910111213141516171819202122232425262728293031FROM python:3.10-slim# Cài đặt các thư viện hệ thống cần thiết (Bổ sung portaudio để fix pyaudio nếu cần)RUN apt-get update && apt-get install -y \ffmpeg git cmake build-essential \portaudio19-dev libasound2-dev libsndfile1-dev \&& rm -rf /var/lib/apt/lists/*WORKDIR /app# Tải mã nguồnRUN git clone --depth 1 https://github.com/fishaudio/fish-speech.git .# Cài đặt PyTorch CPURUN pip install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu# Cài đặt các gói phụ thuộc, bỏ qua PyAudio nếu nó gây lỗi build# Lệnh này sẽ cài các thư viện cần thiết trướcRUN pip install --no-cache-dir setuptools wheelRUN pip install --no-cache-dir -e . || (sed -i '/pyaudio/d' requirements.txt && pip install --no-cache-dir -e .)# Thiết lập cổng cho Hugging FaceENV GRADIO_SERVER_NAME="0.0.0.0"ENV GRADIO_SERVER_PORT=7860ENV PYTHONUNBUFFERED=1# Mở cổng giao diệnEXPOSE 7860# Chạy WebUI và APICMD python -m tools.api_server --device cpu --port 7861 & python -m tools.webui --device cpu123456789101112131415161718192021222324252627FROM python:3.9-slim# Cài đặt thư viện hệ thốngRUN apt-get update && apt-get install -y \ffmpeg git git-lfs cmake build-essential \&& git lfs install \&& rm -rf /var/lib/apt/lists/*WORKDIR /app# 1. Tải mã nguồn GPT-SoVITSRUN git clone https://github.com/RVC-Boss/GPT-SoVITS.git .# 2. Xóa và tải bộ trọng số model đầy đủRUN rm -rf /app/GPT_SoVITS/pretrained_models && \git clone https://huggingface.co/lj1995/GPT-SoVITS /app/GPT_SoVITS/pretrained_models# 3. Cài đặt các thư viện PythonRUN pip install --no-cache-dir -r requirements.txtRUN pip install --no-cache-dir torch-complex fastapi uvicorn# Hugging Face yêu cầu cổng 7860EXPOSE 7860# Lệnh khởi chạy: Chạy API ở nền sau và WebUI ở nền trước# WebUI sẽ hiển thị tại tab "App", API sẽ sẵn sàng cho các công cụ của bạnCMD python api_v2.py -a 0.0.0.0 -p 9880 & python webui.py en
Dockerfile+16-20