forked from zaigie/FunSpeech
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
47 lines (36 loc) · 1.33 KB
/
Copy pathDockerfile
File metadata and controls
47 lines (36 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
FROM python:3.10-slim AS runtime
ENV DEBIAN_FRONTEND=noninteractive \
PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
HF_HUB_DISABLE_SYMLINKS_WARNING=1 \
HF_HUB_DISABLE_PROGRESS_BARS=1
# Install system packages required for audio processing
RUN apt-get update && apt-get install -y --no-install-recommends \
ffmpeg \
sox \
libsox-dev \
libsndfile1 \
build-essential
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Pre-install PyTorch CPU wheels to avoid pulling CUDA runtimes
RUN pip install --no-cache-dir --upgrade pip \
&& pip install --no-cache-dir \
--index-url https://download.pytorch.org/whl/cpu \
torch==2.3.1 \
torchaudio==2.3.1
# Install Python dependencies
COPY dependencies/requirements.txt /tmp/requirements.txt
RUN pip install --no-cache-dir -r /tmp/requirements.txt
COPY dependencies/CosyVoice/requirements-cpu.txt /tmp/requirements-cosyvoice.txt
RUN pip install --no-cache-dir -r /tmp/requirements-cosyvoice.txt
# Clean apt packages and cache
RUN apt remove -y build-essential && apt autoremove -y \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# Copy application code
COPY . .
# Create runtime directories
RUN mkdir -p /app/temp /app/data /app/voices /app/logs \
&& chmod +x start.py
EXPOSE 8000
CMD ["python", "start.py"]