Update Dockerfile
Browse files- Dockerfile +12 -10
Dockerfile
CHANGED
|
@@ -1,29 +1,31 @@
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
| 3 |
-
# Cài đặt
|
| 4 |
RUN apt-get update && apt-get install -y \
|
| 5 |
ffmpeg git cmake build-essential \
|
| 6 |
-
libasound2-dev libsndfile1-dev \
|
| 7 |
&& rm -rf /var/lib/apt/lists/*
|
| 8 |
|
| 9 |
WORKDIR /app
|
| 10 |
|
| 11 |
# Tải mã nguồn
|
| 12 |
-
RUN git clone https://github.com/fishaudio/fish-speech.git .
|
| 13 |
|
| 14 |
-
# Cài đặt PyTorch
|
| 15 |
RUN pip install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
|
| 16 |
|
| 17 |
-
# Cài đặt
|
| 18 |
-
|
| 19 |
-
RUN pip install --no-cache-dir
|
|
|
|
| 20 |
|
| 21 |
-
#
|
| 22 |
ENV GRADIO_SERVER_NAME="0.0.0.0"
|
| 23 |
ENV GRADIO_SERVER_PORT=7860
|
|
|
|
| 24 |
|
| 25 |
-
# Mở cổng
|
| 26 |
EXPOSE 7860
|
| 27 |
|
| 28 |
-
# Chạy
|
| 29 |
CMD python -m tools.api_server --device cpu --port 7861 & python -m tools.webui --device cpu
|
|
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
| 3 |
+
# Cài đặt các thư viện hệ thống cần thiết (Bổ sung portaudio để fix pyaudio nếu cần)
|
| 4 |
RUN apt-get update && apt-get install -y \
|
| 5 |
ffmpeg git cmake build-essential \
|
| 6 |
+
portaudio19-dev libasound2-dev libsndfile1-dev \
|
| 7 |
&& rm -rf /var/lib/apt/lists/*
|
| 8 |
|
| 9 |
WORKDIR /app
|
| 10 |
|
| 11 |
# Tải mã nguồn
|
| 12 |
+
RUN git clone --depth 1 https://github.com/fishaudio/fish-speech.git .
|
| 13 |
|
| 14 |
+
# Cài đặt PyTorch CPU
|
| 15 |
RUN pip install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
|
| 16 |
|
| 17 |
+
# Cài đặt các gói phụ thuộc, bỏ qua PyAudio nếu nó gây lỗi build
|
| 18 |
+
# Lệnh này sẽ cài các thư viện cần thiết trước
|
| 19 |
+
RUN pip install --no-cache-dir setuptools wheel
|
| 20 |
+
RUN pip install --no-cache-dir -e . || (sed -i '/pyaudio/d' requirements.txt && pip install --no-cache-dir -e .)
|
| 21 |
|
| 22 |
+
# Thiết lập cổng cho Hugging Face
|
| 23 |
ENV GRADIO_SERVER_NAME="0.0.0.0"
|
| 24 |
ENV GRADIO_SERVER_PORT=7860
|
| 25 |
+
ENV PYTHONUNBUFFERED=1
|
| 26 |
|
| 27 |
+
# Mở cổng giao diện
|
| 28 |
EXPOSE 7860
|
| 29 |
|
| 30 |
+
# Chạy WebUI và API
|
| 31 |
CMD python -m tools.api_server --device cpu --port 7861 & python -m tools.webui --device cpu
|