Ravishankarsharma commited on
Commit
71ac5a8
·
verified ·
1 Parent(s): e011168

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -7
Dockerfile CHANGED
@@ -1,26 +1,27 @@
1
- # Use lightweight python base image
2
  FROM python:3.10-slim
3
 
4
- # Set working directory
5
  WORKDIR /app
6
 
7
- # Install system dependencies (for Whisper + Torch audio processing)
8
  RUN apt-get update && apt-get install -y ffmpeg git && rm -rf /var/lib/apt/lists/*
9
 
10
  # Upgrade pip
11
  RUN pip install --upgrade pip
12
 
13
- # Copy requirements
14
  COPY requirements.txt .
15
 
16
- # Install Python dependencies
17
  RUN pip install --no-cache-dir -r requirements.txt
18
 
 
 
 
19
  # Copy all project files
20
  COPY . .
21
 
22
- # Expose port (Hugging Face expects 7860 for Gradio or 8000 for FastAPI)
23
  EXPOSE 7860
24
 
25
- # Start FastAPI with Uvicorn (works in Hugging Face)
26
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
1
  FROM python:3.10-slim
2
 
 
3
  WORKDIR /app
4
 
5
+ # Install system dependencies
6
  RUN apt-get update && apt-get install -y ffmpeg git && rm -rf /var/lib/apt/lists/*
7
 
8
  # Upgrade pip
9
  RUN pip install --upgrade pip
10
 
11
+ # Copy requirements first (cache layer)
12
  COPY requirements.txt .
13
 
14
+ # Install Python deps
15
  RUN pip install --no-cache-dir -r requirements.txt
16
 
17
+ # Create upload dir with permissions
18
+ RUN mkdir -p /app/uploads && chmod 777 /app/uploads
19
+
20
  # Copy all project files
21
  COPY . .
22
 
23
+ # Expose Hugging Face port
24
  EXPOSE 7860
25
 
26
+ # Run FastAPI
27
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]