Spaces:
Running
Running
Update dockerfile
Browse files- dockerfile +37 -0
dockerfile
CHANGED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Use official Python image as base
|
2 |
+
FROM python:3.10-slim
|
3 |
+
|
4 |
+
# Install system dependencies
|
5 |
+
RUN apt-get update && apt-get install -y \
|
6 |
+
espeak \
|
7 |
+
ffmpeg \
|
8 |
+
git \
|
9 |
+
&& rm -rf /var/lib/apt/lists/*
|
10 |
+
|
11 |
+
# Set working directory
|
12 |
+
WORKDIR /app
|
13 |
+
|
14 |
+
# Copy requirements first to leverage Docker cache
|
15 |
+
COPY requirements.txt .
|
16 |
+
|
17 |
+
# Install Python dependencies
|
18 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
19 |
+
|
20 |
+
# Download whisper model during build
|
21 |
+
RUN python -c "import whisper; whisper.load_model('small')"
|
22 |
+
|
23 |
+
# Copy the rest of the application
|
24 |
+
COPY . .
|
25 |
+
|
26 |
+
# Environment variables
|
27 |
+
ENV PYTHONUNBUFFERED=1
|
28 |
+
ENV OUTPUT_DIR=/app/outputs
|
29 |
+
|
30 |
+
# Create outputs directory
|
31 |
+
RUN mkdir -p ${OUTPUT_DIR}
|
32 |
+
|
33 |
+
# Expose port for Gradio
|
34 |
+
EXPOSE 7860
|
35 |
+
|
36 |
+
# Command to run the application
|
37 |
+
CMD ["python", "app.py"]
|