Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +3 -80
Dockerfile
CHANGED
@@ -1,85 +1,8 @@
|
|
1 |
FROM python:3.9-slim-buster
|
2 |
-
|
3 |
-
# Install Git (if not already included)
|
4 |
-
RUN apt-get update && apt-get install -y git
|
5 |
-
|
6 |
-
# Set the working directory in the container
|
7 |
WORKDIR /app
|
8 |
-
|
9 |
-
# Copy your entire repository content (including .git, .gitmodules, TTS as a submodule pointer)
|
10 |
COPY . /app/
|
11 |
-
|
12 |
-
# Install build tools and other dependencies BEFORE submodule init
|
13 |
-
RUN apt-get update && apt-get install -y --no-install-recommends \
|
14 |
-
build-essential \
|
15 |
-
cmake \
|
16 |
-
pkg-config \
|
17 |
-
libblis-dev \
|
18 |
-
python3-venv \
|
19 |
-
python3-dev \
|
20 |
-
wget \
|
21 |
-
libopenblas-dev
|
22 |
-
|
23 |
-
# Initialize and update submodules
|
24 |
RUN git submodule init
|
25 |
RUN git submodule update
|
26 |
-
|
27 |
-
|
28 |
-
WORKDIR /app/TTS
|
29 |
-
|
30 |
-
# Set a generic architecture flag
|
31 |
-
ENV BLIS_ARCH="generic"
|
32 |
-
|
33 |
-
# Try to agree to the Coqui TTS license via environment variable
|
34 |
-
ENV COQUI_TTS_AGREED=1
|
35 |
-
|
36 |
-
# Create a virtual environment
|
37 |
-
RUN python3 -m venv venv
|
38 |
-
RUN . /app/venv/bin/activate
|
39 |
-
|
40 |
-
# Install Coqui TTS requirements
|
41 |
-
RUN pip install -r requirements.txt --timeout=300
|
42 |
-
|
43 |
-
# Explicitly install the TTS package itself in editable mode
|
44 |
-
RUN pip install -e . --timeout=300
|
45 |
-
|
46 |
-
# Change working directory back to /app
|
47 |
-
WORKDIR /app
|
48 |
-
|
49 |
-
# Create the model directory
|
50 |
-
RUN mkdir -p /app/models/xtts_v2
|
51 |
-
|
52 |
-
# Download XTTS v2 model files
|
53 |
-
RUN wget -O /app/models/xtts_v2/config.json https://huggingface.co/coqui/XTTS-v2/resolve/main/config.json?download=true
|
54 |
-
RUN wget -O /app/models/xtts_v2/model.pth https://huggingface.co/coqui/XTTS-v2/resolve/main/model.pth?download=true
|
55 |
-
RUN wget -O /app/models/xtts_v2/vocab.json https://huggingface.co/coqui/XTTS-v2/resolve/main/vocab.json?download=true
|
56 |
-
RUN wget -O /app/models/xtts_v2/dvae.pth https://huggingface.co/coqui/XTTS-v2/resolve/main/dvae.pth?download=true
|
57 |
-
RUN wget -O /app/models/xtts_v2/speakers_xtts.pth https://huggingface.co/coqui/XTTS-v2/resolve/main/speakers_xtts.pth?download=true
|
58 |
-
|
59 |
-
# Create the audio directory if it doesn't exist
|
60 |
-
RUN mkdir -p /app/audio
|
61 |
-
|
62 |
-
# Copy the speaker_reference.wav file if it exists at the root
|
63 |
-
COPY speaker_reference.wav /app/audio/speaker_reference.wav
|
64 |
-
|
65 |
-
# Copy the web page files
|
66 |
-
COPY web /app/web
|
67 |
-
|
68 |
-
# Copy the application code
|
69 |
-
COPY local_server_new.py /app/
|
70 |
-
|
71 |
-
# Install your other dependencies (fastapi, uvicorn, bangla, etc.)
|
72 |
-
COPY requirements.txt /app/
|
73 |
-
RUN . /app/venv/bin/activate && pip install -r /app/requirements.txt --no-cache-dir --timeout=300
|
74 |
-
|
75 |
-
# Create start.sh script
|
76 |
-
RUN echo "#!/bin/bash" > start.sh && \
|
77 |
-
echo "source /app/venv/bin/activate" >> start.sh && \
|
78 |
-
echo "/app/venv/bin/python -m uvicorn local_server_new:app --host 0.0.0.0 --port 80" >> start.sh && \
|
79 |
-
chmod +x start.sh
|
80 |
-
|
81 |
-
# Expose port
|
82 |
-
EXPOSE 80
|
83 |
-
|
84 |
-
# Run the app using the script
|
85 |
-
CMD ["./start.sh"]
|
|
|
1 |
FROM python:3.9-slim-buster
|
|
|
|
|
|
|
|
|
|
|
2 |
WORKDIR /app
|
|
|
|
|
3 |
COPY . /app/
|
4 |
+
RUN apt-get update && apt-get install -y git
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
RUN git submodule init
|
6 |
RUN git submodule update
|
7 |
+
RUN ls -al /app/TTS
|
8 |
+
CMD ["echo", "Submodule test complete"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|