Dockerfile 782 B

12345678910111213141516171819202122232425262728293031323334
  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. ./download-ggml-model.sh tiny
  14. # main image
  15. FROM alpine
  16. WORKDIR /app/
  17. # Install dependencies
  18. RUN apk add ffmpeg py3-olm py3-matrix-nio py3-pip py3-pillow gcompat
  19. ADD requirements.txt .
  20. RUN pip install -r requirements.txt
  21. COPY --from=builder /build/main /app/
  22. COPY --from=builder /build/models/ /app/models/
  23. VOLUME /data/
  24. ADD ./*.py /app/
  25. CMD ["python3", "-u", "main.py"]