| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- FROM python:3.11-slim
- # Install system dependencies
- RUN apt-get update && apt-get install -y \
- ffmpeg \
- git \
- build-essential \
- cmake \
- curl \
- && rm -rf /var/lib/apt/lists/*
- # Create working directory
- WORKDIR /app
- # Copy Python dependencies
- COPY requirements.txt .
- # Install Python dependencies
- RUN pip install --no-cache-dir -r requirements.txt
- # Copy server
- COPY server.py .
- # Clone whisper.cpp
- RUN git clone https://github.com/ggerganov/whisper.cpp.git
- # Build whisper.cpp
- RUN cmake -S whisper.cpp -B whisper.cpp/build \
- && cmake --build whisper.cpp/build --config Release
- # Download model
- RUN bash whisper.cpp/models/download-ggml-model.sh small
- # Environment variables for server.py
- ENV WHISPER_BIN=/app/whisper.cpp/build/bin/whisper-cli
- ENV MODEL_PATH=/app/whisper.cpp/models/ggml-small.bin
- # Expose API port
- EXPOSE 5005
- # Run with gunicorn
- CMD ["gunicorn", "-w", "2", "-b", "0.0.0.0:5005", "server:app"]
|