Rajhuggingface4253 commited on
Commit
3e11369
·
verified ·
1 Parent(s): b481cd1

Rename Dockerfile to dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile → dockerfile +31 -28
Dockerfile → dockerfile RENAMED
@@ -1,41 +1,44 @@
1
- FROM python:3.10-slim
2
-
3
- WORKDIR /app
4
-
5
- # Environment variables
6
- ENV HF_HOME=/app/cache
7
- ENV HUGGINGFACE_HUB_CACHE=/app/cache
8
- ENV HF_HUB_DISABLE_LOCKING=1
9
- ENV PYTHONUNBUFFERED=1
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
- # Copy requirements FIRST for better caching
18
- COPY requirements.txt .
19
 
20
- # Install CPU PyTorch FIRST using the correct method
21
- RUN pip install --no-cache-dir \
22
- torch==2.8.0+cpu \
23
- torchaudio==2.8.0+cpu \
24
- --index-url https://download.pytorch.org/whl/cpu
25
 
26
- # Now install the rest of the dependencies
 
27
  RUN pip install --no-cache-dir -r requirements.txt
28
-
29
- # Clone neutts-air
30
- RUN git clone --depth 1 https://github.com/neuphonic/neutts-air.git
31
-
32
- # Copy ONLY the essential app file
 
 
 
 
 
 
 
 
 
33
  COPY app.py .
34
 
35
- EXPOSE 7860
36
 
37
  # Health check
38
  HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
39
- CMD curl -f http://localhost:7860/health || exit 1
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"]