Inayatgaming commited on
Commit
f450182
·
verified ·
1 Parent(s): 1b04a25

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +24 -2
Dockerfile CHANGED
@@ -1,12 +1,34 @@
1
- FROM python:3.10
 
 
 
 
2
 
3
  WORKDIR /app
4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  COPY requirements.txt .
6
- RUN pip install --no-cache-dir -r requirements.txt
7
 
 
8
  COPY . .
9
 
 
 
 
 
10
  EXPOSE 7860
11
 
12
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ FROM python:3.11-slim
2
+
3
+ ENV PYTHONUNBUFFERED=1
4
+ ENV PIP_NO_CACHE_DIR=1
5
+ ENV HF_HOME=/data/.cache/huggingface
6
 
7
  WORKDIR /app
8
 
9
+ # Install required system packages
10
+ RUN apt-get update && \
11
+ apt-get install -y --no-install-recommends \
12
+ ffmpeg \
13
+ git \
14
+ build-essential \
15
+ libsndfile1 \
16
+ && rm -rf /var/lib/apt/lists/*
17
+
18
+ # Upgrade pip
19
+ RUN pip install --upgrade pip
20
+
21
+ # Install Python dependencies
22
  COPY requirements.txt .
23
+ RUN pip install -r requirements.txt
24
 
25
+ # Copy project
26
  COPY . .
27
 
28
+ # Pre-download the model during build
29
+ RUN python -c "from huggingface_hub import snapshot_download; snapshot_download('harrrshall/xtts-v2-hinglish-synthetic')"
30
+
31
+ # Hugging Face Docker Space port
32
  EXPOSE 7860
33
 
34
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]