Spaces:
Paused
Paused
Rename Dockerfile to dockerfile
Browse files- Dockerfile → dockerfile +31 -28
Dockerfile → dockerfile
RENAMED
|
@@ -1,41 +1,44 @@
|
|
| 1 |
-
FROM python:3.
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
# Install ONLY essential system deps
|
| 12 |
-
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 13 |
-
espeak-ng libsndfile1 git curl \
|
| 14 |
&& rm -rf /var/lib/apt/lists/* \
|
| 15 |
&& apt-get clean
|
| 16 |
|
| 17 |
-
|
| 18 |
-
COPY requirements.txt .
|
| 19 |
|
| 20 |
-
#
|
| 21 |
-
RUN
|
| 22 |
-
torch==2.8.0+cpu \
|
| 23 |
-
torchaudio==2.8.0+cpu \
|
| 24 |
-
--index-url https://download.pytorch.org/whl/cpu
|
| 25 |
|
| 26 |
-
#
|
|
|
|
| 27 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
COPY app.py .
|
| 34 |
|
| 35 |
-
EXPOSE
|
| 36 |
|
| 37 |
# Health check
|
| 38 |
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
|
| 39 |
-
CMD curl -f http://localhost:
|
| 40 |
|
| 41 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 1 |
+
FROM python:3.9-slim
|
| 2 |
+
|
| 3 |
+
# Install system dependencies
|
| 4 |
+
RUN apt-get update && apt-get install -y \
|
| 5 |
+
espeak \
|
| 6 |
+
espeak-data \
|
| 7 |
+
libsndfile1 \
|
| 8 |
+
git \
|
| 9 |
+
wget \
|
| 10 |
+
curl \
|
|
|
|
|
|
|
|
|
|
| 11 |
&& rm -rf /var/lib/apt/lists/* \
|
| 12 |
&& apt-get clean
|
| 13 |
|
| 14 |
+
WORKDIR /app
|
|
|
|
| 15 |
|
| 16 |
+
# Clone NeuTTS Air
|
| 17 |
+
RUN git clone https://github.com/neuphonic/neutts-air.git .
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
+
# Install Python dependencies
|
| 20 |
+
RUN pip install --no-cache-dir --upgrade pip
|
| 21 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 22 |
+
RUN pip install --no-cache-dir \
|
| 23 |
+
fastapi==0.104.1 \
|
| 24 |
+
uvicorn==0.24.0 \
|
| 25 |
+
python-multipart==0.0.6 \
|
| 26 |
+
soundfile==0.12.1 \
|
| 27 |
+
torch==2.0.1 \
|
| 28 |
+
transformers==4.35.0 \
|
| 29 |
+
pydantic==2.4.2 \
|
| 30 |
+
numpy==1.24.3
|
| 31 |
+
|
| 32 |
+
# Create necessary directories
|
| 33 |
+
RUN mkdir -p /app/models /app/temp_audio
|
| 34 |
+
|
| 35 |
+
# Copy application
|
| 36 |
COPY app.py .
|
| 37 |
|
| 38 |
+
EXPOSE 8000
|
| 39 |
|
| 40 |
# Health check
|
| 41 |
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
|
| 42 |
+
CMD curl -f http://localhost:8000/health || exit 1
|
| 43 |
|
| 44 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|