WaysAhead Global commited on
Commit
22949fa
·
verified ·
1 Parent(s): 3815adf

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +21 -5
Dockerfile CHANGED
@@ -7,10 +7,13 @@ ENV PYTHONUNBUFFERED=1
7
  ENV MPLCONFIGDIR="/app/matplotlib"
8
  ENV DEEPFACE_HOME="/app/.deepface"
9
 
10
- # Install system dependencies
11
  RUN apt-get update && apt-get install -y \
12
  build-essential \
13
  cmake \
 
 
 
14
  libgl1-mesa-glx \
15
  libglib2.0-0 \
16
  libopenblas-dev \
@@ -22,11 +25,24 @@ RUN apt-get update && apt-get install -y \
22
  # Set working directory
23
  WORKDIR /app
24
 
25
- # Copy application files
 
 
 
 
 
 
 
 
 
 
 
 
 
26
  COPY . /app
27
 
28
- # Create necessary directories and set full permissions
29
- RUN mkdir -p /app/matplotlib /app/.deepface /app/tmp /app/data /app/static && \
30
  chmod -R 777 /app/.deepface /app/matplotlib /app/tmp /app/data /app/static
31
 
32
  # Install Python dependencies
@@ -37,5 +53,5 @@ RUN pip install --no-cache-dir --upgrade pip && \
37
  # Expose FastAPI default port
38
  EXPOSE 7860
39
 
40
- # Start FastAPI with multiple workers
41
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "8"]
 
7
  ENV MPLCONFIGDIR="/app/matplotlib"
8
  ENV DEEPFACE_HOME="/app/.deepface"
9
 
10
+ # 🧩 Install system dependencies (Add ffmpeg, git, curl for SadTalker)
11
  RUN apt-get update && apt-get install -y \
12
  build-essential \
13
  cmake \
14
+ ffmpeg \ # <-- required for SadTalker video synthesis
15
+ git \
16
+ curl \
17
  libgl1-mesa-glx \
18
  libglib2.0-0 \
19
  libopenblas-dev \
 
25
  # Set working directory
26
  WORKDIR /app
27
 
28
+ # 🧱 Clone SadTalker into container (optional: can also COPY if you have it locally)
29
+ RUN git clone https://github.com/OpenTalker/SadTalker.git /app/SadTalker
30
+
31
+ # 📦 Install SadTalker requirements
32
+ WORKDIR /app/SadTalker
33
+ RUN pip install --no-cache-dir -r requirements.txt
34
+
35
+ # 📥 Download SadTalker models
36
+ RUN bash scripts/download_models.sh
37
+
38
+ # 🧹 Return to main working directory
39
+ WORKDIR /app
40
+
41
+ # Copy your FastAPI app code
42
  COPY . /app
43
 
44
+ # Create necessary directories and set permissions
45
+ RUN mkdir -p /app/matplotlib /app/.deepface /app/tmp /app/data /app/static/video && \
46
  chmod -R 777 /app/.deepface /app/matplotlib /app/tmp /app/data /app/static
47
 
48
  # Install Python dependencies
 
53
  # Expose FastAPI default port
54
  EXPOSE 7860
55
 
56
+ # 🔥 Start FastAPI
57
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "8"]