Update Dockerfile
Browse files- Dockerfile +7 -29
Dockerfile
CHANGED
|
@@ -1,35 +1,13 @@
|
|
| 1 |
FROM python:3.9-slim
|
| 2 |
-
|
| 3 |
-
RUN apt-get update && apt-get install -y \
|
| 4 |
-
ffmpeg git cmake build-essential \
|
| 5 |
-
&& rm -rf /var/lib/apt/lists/*
|
| 6 |
-
|
| 7 |
WORKDIR /app
|
| 8 |
-
|
| 9 |
-
#
|
| 10 |
-
RUN
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 15 |
RUN pip install --no-cache-dir underthesea
|
| 16 |
-
|
| 17 |
-
# 3. FIX LỖI TOKENIZER: Tải sẵn bộ Roberta về để không bị báo OSError
|
| 18 |
-
RUN mkdir -p GPT_SoVITS/pretrained_models/chinese-roberta-wwm-ext-large && \
|
| 19 |
-
git clone --depth 1 https://huggingface.co/hfl/chinese-roberta-wwm-ext-large /tmp/roberta && \
|
| 20 |
-
cp -r /tmp/roberta/* GPT_SoVITS/pretrained_models/chinese-roberta-wwm-ext-large/ && \
|
| 21 |
-
rm -rf /tmp/roberta
|
| 22 |
-
|
| 23 |
-
# 4. FIX CỔNG 7860: Ép ứng dụng chạy đúng cổng của Hugging Face
|
| 24 |
-
ENV is_half=False
|
| 25 |
-
ENV device=cpu
|
| 26 |
-
ENV webui_port=7860
|
| 27 |
-
ENV PYTHONUNBUFFERED=1
|
| 28 |
-
|
| 29 |
EXPOSE 7860
|
| 30 |
-
|
| 31 |
-
# Dùng lệnh sed để sửa trực tiếp file code gốc, ép nó mở cổng 7860
|
| 32 |
-
RUN sed -i 's/9874/7860/g' webui.py
|
| 33 |
-
|
| 34 |
-
# Khởi chạy
|
| 35 |
CMD ["python", "webui.py", "en"]
|
|
|
|
| 1 |
FROM python:3.9-slim
|
| 2 |
+
RUN apt-get update && apt-get install -y ffmpeg git cmake build-essential && rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
WORKDIR /app
|
| 4 |
+
COPY . .
|
| 5 |
+
# Tự động tải model cơ bản để máy có thể khởi động
|
| 6 |
+
RUN mkdir -p GPT_SoVITS/pretrained_models && \
|
| 7 |
+
git clone --depth 1 https://huggingface.co/lj1995/GPT-SoVITS /tmp/models && \
|
| 8 |
+
cp -r /tmp/models/* GPT_SoVITS/pretrained_models/ && \
|
| 9 |
+
rm -rf /tmp/models
|
| 10 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 11 |
RUN pip install --no-cache-dir underthesea
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
EXPOSE 7860
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
CMD ["python", "webui.py", "en"]
|