45 lines
1.1 KiB
Docker
45 lines
1.1 KiB
Docker
FROM python:3.11-slim
|
|
|
|
# Install system dependencies
|
|
RUN apt-get update && apt-get install -y \
|
|
ffmpeg \
|
|
wget \
|
|
git \
|
|
build-essential \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Install whisper.cpp
|
|
WORKDIR /tmp
|
|
RUN git clone https://github.com/ggerganov/whisper.cpp.git && \
|
|
cd whisper.cpp && \
|
|
make && \
|
|
cp main /usr/local/bin/whisper.cpp && \
|
|
chmod +x /usr/local/bin/whisper.cpp
|
|
|
|
# Download whisper model
|
|
RUN mkdir -p /models && \
|
|
cd /models && \
|
|
wget -q https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-base.en.bin && \
|
|
mv ggml-base.en.bin ggml-base.bin
|
|
|
|
# Set up application directory
|
|
WORKDIR /app
|
|
|
|
# Copy requirements and install Python dependencies
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
# Copy application code
|
|
COPY agent.py .
|
|
|
|
# Create directories for videos
|
|
RUN mkdir -p /raw_movies /final_movies
|
|
|
|
# Set environment variables with defaults
|
|
ENV RAW_DIR=/raw_movies \
|
|
FINAL_DIR=/final_movies \
|
|
WHISPER_MODEL=/models/ggml-base.bin \
|
|
VAAPI_DEVICE=/dev/dri/renderD128
|
|
|
|
CMD ["python", "-u", "agent.py"]
|