FROM nvidia/cuda:12.3.2-cudnn9-devel-ubuntu22.04 | |
# Set environment variables | |
ENV DEBIAN_FRONTEND=noninteractive | |
ENV PYTHONUNBUFFERED=1 | |
ENV FLASH_ATTENTION_SKIP_CUDA_BUILD=TRUE | |
# Install system dependencies | |
RUN apt-get update && apt-get install -y \ | |
python3.10 \ | |
python3-pip \ | |
python3.10-dev \ | |
build-essential \ | |
ninja-build \ | |
git \ | |
&& rm -rf /var/lib/apt/lists/* | |
# Create and set working directory | |
WORKDIR /app | |
# Copy requirements first to leverage Docker cache | |
COPY requirements.txt . | |
# Install Python dependencies | |
RUN pip3 install --no-cache-dir -r requirements.txt | |
# Install flash-attention | |
RUN pip3 install --no-cache-dir flash-attn --no-build-isolation | |
# Copy the rest of the application | |
COPY . . | |
# Set the default command | |
CMD ["python3", "-m", "src.video_processor.processor"] |