Dockerfile 839 B

12345678910111213141516171819202122232425262728293031323334353637
  1. # build image
  2. FROM debian:bullseye-slim AS builder
  3. WORKDIR /build/
  4. RUN apt-get update && apt-get install --no-install-recommends -y \
  5. make gcc g++ wget \
  6. && apt-get clean \
  7. && rm -rf /var/lib/apt/lists/*
  8. # Install Whisper.cpp
  9. ADD whisper.cpp/ /build/
  10. RUN gcc -pthread -O3 -march=native -c ggml.c && \
  11. g++ -pthread -O3 -std=c++11 -c main.cpp && \
  12. g++ -pthread -o main ggml.o main.o
  13. # main image
  14. FROM python:3.9-slim-bullseye
  15. WORKDIR /app/
  16. # Install dependencies
  17. RUN apt-get update && apt-get install -y \
  18. ffmpeg libolm-dev gcc make wget\
  19. && apt-get clean \
  20. && rm -rf /var/lib/apt/lists/*
  21. ADD requirements.txt .
  22. RUN pip install -r requirements.txt && \
  23. apt-get remove -y gcc make && \
  24. apt-get autoremove -y
  25. COPY --from=builder /build/main /app/
  26. VOLUME /data/
  27. ADD ./*.py /app/
  28. CMD ["python3", "-u", "main.py"]