# Use an official Python runtime as the base image | |
FROM python:3.9-slim | |
# Set working directory | |
WORKDIR /app | |
# Install system dependencies (e.g., FFmpeg for moviepy) | |
RUN apt-get update && apt-get install -y \ | |
ffmpeg \ | |
&& rm -rf /var/lib/apt/lists/* | |
# Copy requirements file | |
COPY requirements.txt . | |
# Install Python dependencies | |
RUN pip install --no-cache-dir -r requirements.txt | |
# Copy the app file | |
COPY app.py . | |
# Expose the port Hugging Face Spaces expects | |
EXPOSE 7860 | |
# Command to run the Streamlit app | |
CMD ["streamlit", "run", "app.py", "--server.port", "7860", "--server.address", "0.0.0.0"] |