-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.cpu
More file actions
57 lines (46 loc) · 1.68 KB
/
Dockerfile.cpu
File metadata and controls
57 lines (46 loc) · 1.68 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
48
49
50
51
52
53
54
55
56
57
# Use a lighter base image (Python 3.10 slim version)
FROM python:3.10-slim
# Set environment variables
ENV PYTHONUNBUFFERED=1
ENV PATH="/root/.local/bin:$PATH"
ENV COQUI_TOS_AGREED=1
# Create a working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
libsndfile1 \
portaudio19-dev \
wget \
curl \
pulseaudio \
libsdl2-dev \
dbus \
&& rm -rf /var/lib/apt/lists/*
# Install ffmpeg
RUN apt-get update && apt-get install -y ffmpeg && rm -rf /var/lib/apt/lists/*
# Configure dbus
RUN dbus-uuidgen > /etc/machine-id
# Configure ALSA to use PulseAudio
RUN echo "pcm.!default pulse" > /root/.asoundrc && \
echo "ctl.!default pulse" >> /root/.asoundrc
# Ensure the directory exists before writing to the file
RUN mkdir -p /usr/share/alsa/alsa.conf.d && \
echo "defaults.pcm.card 0" >> /usr/share/alsa/alsa.conf.d/99-pulseaudio-defaults.conf && \
echo "defaults.ctl.card 0" >> /usr/share/alsa/alsa.conf.d/99-pulseaudio-defaults.conf
# Copy only necessary files (EXCLUDING large checkpoint and XTTS-v2)
COPY requirements_cpu.txt /app/requirements.txt
COPY app /app/app
COPY characters /app/characters
COPY outputs /app/outputs
COPY cli.py /app/cli.py
COPY elevenlabs_voices.json /app/elevenlabs_voices.json
COPY .env.sample /app/.env.sample
COPY README.md /app/README.md
COPY LICENSE /app/LICENSE
# Install Python dependencies (without cache to reduce image size)
RUN pip install --upgrade pip && pip install --no-cache-dir -r /app/requirements.txt
# Expose the port that the app runs on
EXPOSE 8000
# Command to run the application
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]