Update Dockerfile
Browse files12343 unmodified lines8910111213141516171819202122232425262728# Đổi từ python 3.10 sang 3.11 để tương thích hoàn toàn với numpy 2.3.4 và networkx 3.5FROM python:3.11-slim# 1. Cài đặt thư viện hệ thống3 unmodified linesWORKDIR /app# 2. Tự động lấy code từ GitHubRUN git clone https://github.com/pnnbao97/VieNeu-TTS.git .# 3. Cài đặt các thư viện Python (Sẽ trơn tru vì đã dùng Python 3.11)RUN pip install --no-cache-dir --upgrade pipRUN pip install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpuRUN pip install --no-cache-dir -r requirements.txtRUN pip install --no-cache-dir neucodec>=0.0.4 phonemizer>=3.3.0# 4. Cấu hình Gradio cho Hugging FaceENV GRADIO_SERVER_NAME="0.0.0.0"ENV GRADIO_SERVER_PORT=7860ENV PYTHONUNBUFFERED=1EXPOSE 7860# 5. Chạy giao diện chínhCMD ["python", "gradio_app.py"]12343 unmodified lines8910111213141516171819202122232425262728293031323334353637# 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.0# 5. Cấu hình Hugging FaceENV GRADIO_SERVER_NAME="0.0.0.0"ENV GRADIO_SERVER_PORT=7860ENV PYTHONUNBUFFERED=1EXPOSE 7860# 6. Chạy giao diệnCMD ["python", "gradio_app.py"]
Dockerfile+14-5