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