FROM ubuntu:22.04 # Install dependencies RUN apt-get update && apt-get install -y \ python3 \ python3-pip \ git \ cmake \ make \ g++ \ ffmpeg \ curl \ && rm -rf /var/lib/apt/lists/* # Set working directory WORKDIR /app # Clone and build whisper.cpp RUN git clone https://github.com/ggerganov/whisper.cpp.git && \ cd whisper.cpp && \ make # Download the small.en model RUN cd whisper.cpp/models && \ curl -L "https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-small.en.bin" --output ggml-small.en.bin # Install Python dependencies COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy API code COPY app.py . # Create uploads directory RUN mkdir -p uploads # Correct paths (critical fix!) ENV WHISPER_CPP_PATH="/app/whisper.cpp/main" ENV MODEL_PATH="/app/whisper.cpp/models/ggml-small.en.bin" # Verify the binary exists (debugging step) RUN ls -lh /app/whisper.cpp/main && \ ls -lh /app/whisper.cpp/models/ggml-small.en.bin EXPOSE 5000 CMD ["python3", "app.py"]