Update Dockerfile
Browse files- Dockerfile +8 -6
Dockerfile
CHANGED
|
@@ -1,27 +1,29 @@
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
| 3 |
-
# 1. Cài đặt
|
| 4 |
RUN apt-get update && apt-get install -y \
|
| 5 |
ffmpeg git cmake build-essential espeak-ng \
|
| 6 |
&& rm -rf /var/lib/apt/lists/*
|
| 7 |
|
| 8 |
WORKDIR /app
|
| 9 |
|
| 10 |
-
# 2.
|
| 11 |
-
# Lệnh này giúp server Hugging Face tự tải code về, không bị giới hạn 10MB từ máy bạn
|
| 12 |
RUN git clone https://github.com/pnnbao97/VieNeu-TTS.git .
|
| 13 |
|
| 14 |
-
# 3.
|
|
|
|
|
|
|
|
|
|
| 15 |
RUN pip install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
|
| 16 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 17 |
RUN pip install --no-cache-dir neucodec>=0.0.4 phonemizer>=3.3.0
|
| 18 |
|
| 19 |
-
#
|
| 20 |
ENV GRADIO_SERVER_NAME="0.0.0.0"
|
| 21 |
ENV GRADIO_SERVER_PORT=7860
|
| 22 |
ENV PYTHONUNBUFFERED=1
|
| 23 |
|
| 24 |
EXPOSE 7860
|
| 25 |
|
| 26 |
-
#
|
| 27 |
CMD ["python", "gradio_app.py"]
|
|
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
| 3 |
+
# 1. Cài đặt thư viện hệ thống
|
| 4 |
RUN apt-get update && apt-get install -y \
|
| 5 |
ffmpeg git cmake build-essential espeak-ng \
|
| 6 |
&& rm -rf /var/lib/apt/lists/*
|
| 7 |
|
| 8 |
WORKDIR /app
|
| 9 |
|
| 10 |
+
# 2. Tải code từ GitHub
|
|
|
|
| 11 |
RUN git clone https://github.com/pnnbao97/VieNeu-TTS.git .
|
| 12 |
|
| 13 |
+
# 3. SỬA LỖI VERSION: Hạ cấp networkx xuống 3.2.1 để chạy được trên Python 3.10
|
| 14 |
+
RUN sed -i 's/networkx==3.5/networkx==3.2.1/g' requirements.txt
|
| 15 |
+
|
| 16 |
+
# 4. Cài đặt các thư viện Python
|
| 17 |
RUN pip install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
|
| 18 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 19 |
RUN pip install --no-cache-dir neucodec>=0.0.4 phonemizer>=3.3.0
|
| 20 |
|
| 21 |
+
# 5. Cấu hình Gradio
|
| 22 |
ENV GRADIO_SERVER_NAME="0.0.0.0"
|
| 23 |
ENV GRADIO_SERVER_PORT=7860
|
| 24 |
ENV PYTHONUNBUFFERED=1
|
| 25 |
|
| 26 |
EXPOSE 7860
|
| 27 |
|
| 28 |
+
# 6. Chạy giao diện
|
| 29 |
CMD ["python", "gradio_app.py"]
|