Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +10 -40
Dockerfile
CHANGED
|
@@ -1,15 +1,15 @@
|
|
| 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 (
|
| 10 |
COPY . /app/
|
| 11 |
|
| 12 |
-
# Install build tools and
|
| 13 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 14 |
build-essential \
|
| 15 |
cmake \
|
|
@@ -20,41 +20,15 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
| 20 |
wget \
|
| 21 |
libopenblas-dev
|
| 22 |
|
| 23 |
-
#
|
| 24 |
-
RUN
|
| 25 |
-
RUN
|
| 26 |
-
|
| 27 |
-
# Set the working directory to the TTS directory AFTER updating submodules
|
| 28 |
-
WORKDIR /app/TTS
|
| 29 |
-
|
| 30 |
-
# Set a generic architecture flag
|
| 31 |
-
ENV BLIS_ARCH="generic"
|
| 32 |
|
| 33 |
-
#
|
| 34 |
-
|
| 35 |
|
| 36 |
-
#
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
# Create a virtual environment
|
| 40 |
-
RUN python3 -m venv /app/venv
|
| 41 |
-
|
| 42 |
-
# Install Coqui TTS requirements using the venv's pip, finding the file dynamically
|
| 43 |
-
RUN find /app/TTS -name "requirements.txt" -exec /app/venv/bin/pip install -r {} --timeout=300 \;
|
| 44 |
-
|
| 45 |
-
# Find the directory containing setup.py
|
| 46 |
-
RUN SETUP_PY_DIR=$(find /app/TTS -name "setup.py" -printf "%h\n") && \
|
| 47 |
-
if [ -n "$SETUP_PY_DIR" ]; then \
|
| 48 |
-
echo "Found setup.py in: $SETUP_PY_DIR"; \
|
| 49 |
-
cd "$SETUP_PY_DIR"; \
|
| 50 |
-
/app/venv/bin/pip install -e . --timeout=300; \
|
| 51 |
-
else \
|
| 52 |
-
echo "Error: setup.py not found in /app/TTS or its subdirectories."; \
|
| 53 |
-
exit 1; \
|
| 54 |
-
fi
|
| 55 |
-
|
| 56 |
-
# Change working directory back to /app
|
| 57 |
-
WORKDIR /app
|
| 58 |
|
| 59 |
# Create the model directory
|
| 60 |
RUN mkdir -p /app/models/xtts_v2
|
|
@@ -78,10 +52,6 @@ COPY web /app/web
|
|
| 78 |
# Copy the application code
|
| 79 |
COPY local_server_new.py /app/
|
| 80 |
|
| 81 |
-
# Install your other dependencies (fastapi, uvicorn, bangla, etc.) using the venv's pip
|
| 82 |
-
COPY requirements.txt /app/
|
| 83 |
-
RUN /app/venv/bin/pip install --no-cache-dir -r requirements.txt --timeout=300
|
| 84 |
-
|
| 85 |
# Create start.sh script
|
| 86 |
RUN echo "#!/bin/bash" > start.sh && \
|
| 87 |
echo "source /app/venv/bin/activate" >> start.sh && \
|
|
|
|
| 1 |
FROM python:3.9-slim-buster
|
| 2 |
|
| 3 |
+
# Install Git (if not already included - might be needed for other parts of your repo)
|
| 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 (excluding the potentially problematic TTS submodule)
|
| 10 |
COPY . /app/
|
| 11 |
|
| 12 |
+
# Install build tools and libblis-dev BEFORE anything else
|
| 13 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 14 |
build-essential \
|
| 15 |
cmake \
|
|
|
|
| 20 |
wget \
|
| 21 |
libopenblas-dev
|
| 22 |
|
| 23 |
+
# Create a virtual environment
|
| 24 |
+
RUN python3 -m venv venv
|
| 25 |
+
RUN . /app/venv/bin/activate
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
+
# Copy the requirements.txt file
|
| 28 |
+
COPY requirements.txt /app/
|
| 29 |
|
| 30 |
+
# Install all dependencies, including TTS, from the requirements.txt
|
| 31 |
+
RUN pip install --no-cache-dir -r /app/requirements.txt --timeout=300
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
|
| 33 |
# Create the model directory
|
| 34 |
RUN mkdir -p /app/models/xtts_v2
|
|
|
|
| 52 |
# Copy the application code
|
| 53 |
COPY local_server_new.py /app/
|
| 54 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
# Create start.sh script
|
| 56 |
RUN echo "#!/bin/bash" > start.sh && \
|
| 57 |
echo "source /app/venv/bin/activate" >> start.sh && \
|