Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +4 -27
Dockerfile
CHANGED
|
@@ -1,15 +1,12 @@
|
|
| 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
|
| 13 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 14 |
build-essential \
|
| 15 |
cmake \
|
|
@@ -20,27 +17,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
| 20 |
wget \
|
| 21 |
libopenblas-dev
|
| 22 |
|
| 23 |
-
# Initialize and update submodules
|
| 24 |
-
RUN git submodule init
|
| 25 |
-
RUN git submodule update
|
| 26 |
-
|
| 27 |
-
# Set the working directory to the TTS directory for TTS installation
|
| 28 |
-
WORKDIR /app/TTS
|
| 29 |
-
|
| 30 |
-
# Try to agree to the Coqui TTS license
|
| 31 |
-
ENV COQUI_TTS_AGREED=1
|
| 32 |
-
|
| 33 |
# Create a virtual environment
|
| 34 |
-
RUN python3 -m venv
|
| 35 |
|
| 36 |
-
# Install
|
| 37 |
-
RUN /app/venv/bin/pip install -r
|
| 38 |
-
|
| 39 |
-
# Explicitly install the TTS package itself in editable mode using the venv's pip
|
| 40 |
-
RUN /app/venv/bin/pip install -e . --timeout=300
|
| 41 |
-
|
| 42 |
-
# Change working directory back to /app for the rest of the app
|
| 43 |
-
WORKDIR /app
|
| 44 |
|
| 45 |
# Create the model directory
|
| 46 |
RUN mkdir -p /app/models/xtts_v2
|
|
@@ -64,10 +45,6 @@ COPY web /app/web
|
|
| 64 |
# Copy the application code
|
| 65 |
COPY local_server_new.py /app/
|
| 66 |
|
| 67 |
-
# Install your other dependencies (fastapi, uvicorn, etc.) from the root requirements.txt using the venv's pip
|
| 68 |
-
COPY requirements.txt /app/
|
| 69 |
-
RUN /app/venv/bin/pip install --no-cache-dir -r /app/requirements.txt --timeout=300
|
| 70 |
-
|
| 71 |
# Create start.sh script
|
| 72 |
RUN echo "#!/bin/bash" > start.sh && \
|
| 73 |
echo "source /app/venv/bin/activate" >> start.sh && \
|
|
|
|
| 1 |
FROM python:3.9-slim-buster
|
| 2 |
|
|
|
|
|
|
|
|
|
|
| 3 |
# Set the working directory in the container
|
| 4 |
WORKDIR /app
|
| 5 |
|
| 6 |
# Copy your entire repository content
|
| 7 |
COPY . /app/
|
| 8 |
|
| 9 |
+
# Install build tools (might be needed by some dependencies)
|
| 10 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 11 |
build-essential \
|
| 12 |
cmake \
|
|
|
|
| 17 |
wget \
|
| 18 |
libopenblas-dev
|
| 19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
# Create a virtual environment
|
| 21 |
+
RUN python3 -m venv venv
|
| 22 |
|
| 23 |
+
# Install all dependencies, including TTS, from the root requirements.txt
|
| 24 |
+
RUN . /app/venv/bin/activate && pip install --no-cache-dir -r requirements.txt --timeout=300
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
|
| 26 |
# Create the model directory
|
| 27 |
RUN mkdir -p /app/models/xtts_v2
|
|
|
|
| 45 |
# Copy the application code
|
| 46 |
COPY local_server_new.py /app/
|
| 47 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
# Create start.sh script
|
| 49 |
RUN echo "#!/bin/bash" > start.sh && \
|
| 50 |
echo "source /app/venv/bin/activate" >> start.sh && \
|