FROM python:3.9-slim | |
# Install system packages | |
RUN apt-get update && apt-get install -y ffmpeg imagemagick | |
# Install pip packages | |
RUN pip install cog | |
# Set the working directory | |
WORKDIR /src | |
# Copy the requirements.txt file first to leverage Docker cache | |
COPY requirements.txt . | |
# Install the Python packages | |
RUN pip install -r requirements.txt | |
# Copy the rest of the application code | |
COPY . . | |
# Set the entry point for Cog | |
ENTRYPOINT ["cog", "predict"] |