vipsphi commited on
Commit
565de57
·
verified ·
1 Parent(s): 5169683

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -10
Dockerfile CHANGED
@@ -1,29 +1,31 @@
1
  FROM python:3.10-slim
2
 
3
- # Cài đặt đầy đủ thư viện hệ thống để tránh lỗi biên dịch (Exit code 1)
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 bản nhẹ (CPU)
15
  RUN pip install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
16
 
17
- # Cài đặt Fish Speech sửa lỗi phụ thuộc
18
- RUN pip install --no-cache-dir -e .
19
- RUN pip install --no-cache-dir gradio open-webui
 
20
 
21
- # Cấu hình cổng Hugging Face
22
  ENV GRADIO_SERVER_NAME="0.0.0.0"
23
  ENV GRADIO_SERVER_PORT=7860
 
24
 
25
- # Mở cổng API nội bộ
26
  EXPOSE 7860
27
 
28
- # Chạy cả API Server WebUI
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 WebUIAPI
31
  CMD python -m tools.api_server --device cpu --port 7861 & python -m tools.webui --device cpu