Create Dockerfile
Browse files- Dockerfile +28 -0
Dockerfile
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Start from a clean, official Python 3.10 base image
|
2 |
+
FROM python:3.10-slim
|
3 |
+
|
4 |
+
# Set the working directory in the container
|
5 |
+
WORKDIR /app
|
6 |
+
|
7 |
+
# Install system dependency ffmpeg, which moviepy needs
|
8 |
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
9 |
+
ffmpeg \
|
10 |
+
&& rm -rf /var/lib/apt/lists/*
|
11 |
+
|
12 |
+
# Copy ONLY the requirements file first to leverage Docker's cache
|
13 |
+
COPY requirements.txt .
|
14 |
+
|
15 |
+
# Install all Python dependencies from the requirements file in one single, clean step
|
16 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
17 |
+
|
18 |
+
# Pre-download the OpenAI Whisper model to prevent runtime timeouts
|
19 |
+
RUN python -c "import whisper; whisper.load_model('base')"
|
20 |
+
|
21 |
+
# Now, copy the rest of your application code into the container
|
22 |
+
COPY . .
|
23 |
+
|
24 |
+
# Expose the port that Gradio will run on (default is 7860)
|
25 |
+
EXPOSE 7860
|
26 |
+
|
27 |
+
# Set the command to run your Gradio application
|
28 |
+
CMD ["python", "app.py"]
|