sidmazak commited on
Commit
0b66c08
·
verified ·
1 Parent(s): 4ac2709

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +30 -0
Dockerfile ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use a lightweight Python image
2
+ FROM python:3.10-slim
3
+
4
+ # Set the working directory
5
+ WORKDIR /app
6
+
7
+ # Install system dependencies
8
+ # ffmpeg is required for audio processing by faster-whisper
9
+ RUN apt-get update && apt-get install -y ffmpeg && rm -rf /var/lib/apt/lists/*
10
+
11
+ # Copy the requirements file first to cache dependencies
12
+ COPY requirements.txt .
13
+
14
+ # Install Python dependencies
15
+ RUN pip install --no-cache-dir -r requirements.txt
16
+
17
+ # Copy the application code
18
+ COPY app.py .
19
+
20
+ # Expose the port Hugging Face Spaces expects
21
+ EXPOSE 7860
22
+
23
+ # Set environment variables
24
+ ENV PYTHONUNBUFFERED=1
25
+ # Ensure we run on the correct interface
26
+ ENV HOST=0.0.0.0
27
+ ENV PORT=7860
28
+
29
+ # Run the application
30
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]