Update Dockerfile
Browse files12343 unmodified lines8910111213141516171819202122232425262728# Sử dụng Python 3.11 để tương thích tốt nhấtFROM python:3.11-slim# 1. Cài đặt thư viện hệ thống3 unmodified linesWORKDIR /app# 2. Tải code từ GitHubRUN git clone https://github.com/pnnbao97/VieNeu-TTS.git .# 3. DỌN DẸP requirements.txt: Xóa các yêu cầu phiên bản Torch cụ thể để tránh lỗi CUDA/CPU# Lệnh này xóa các dòng bắt đầu bằng torch, torchvision, torchaudio trong file gốcRUN sed -i '/torch/d' requirements.txt && \sed -i '/numpy/d' requirements.txt# 4. CÀI ĐẶT THƯ VIỆN THEO THỨ TỰ CHUẨNRUN pip install --no-cache-dir --upgrade pip# Cài đặt Torch CPU trướcRUN pip install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu# Cài đặt numpy bản ổn định cho Python 3.11RUN pip install --no-cache-dir "numpy<2.1.0"# Cài đặt các thư viện còn lạiRUN pip install --no-cache-dir -r requirements.txtRUN pip install --no-cache-dir neucodec>=0.0.4 phonemizer>=3.3.01233 unmodified lines7891011121314151617181920212223242526272829FROM python:3.11-slim# 1. Cài đặt thư viện hệ thống3 unmodified linesWORKDIR /app# 2. TẢI MÃ NGUỒN LÊN TRƯỚC (Clone từ GitHub)RUN git clone https://github.com/pnnbao97/VieNeu-TTS.git .# 3. DỌN DẸP TRIỆT ĐỂ requirements.txt# Xóa triton-windows (vì đây là Linux), xóa torch/numpy để cài bản riêngRUN sed -i '/triton-windows/d' requirements.txt && \sed -i '/torch/d' requirements.txt && \sed -i '/numpy/d' requirements.txt && \sed -i '/networkx/d' requirements.txt# 4. CÀI ĐẶT TỪNG BƯỚC AN TOÀNRUN pip install --no-cache-dir --upgrade pip# Cài Torch CPURUN pip install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu# Cài các bản thư viện tương thích Python 3.11RUN pip install --no-cache-dir "numpy<2.1.0" "networkx<3.3"# Cài các gói còn lại trong requirements.txt (sau khi đã dọn dẹp lỗi)RUN pip install --no-cache-dir -r requirements.txtRUN pip install --no-cache-dir neucodec>=0.0.4 phonemizer>=3.3.0
Dockerfile+12-11