40 lines
675 B
Docker
40 lines
675 B
Docker
FROM ubuntu:22.04
|
|
|
|
WORKDIR /app
|
|
|
|
# Install dependencies
|
|
RUN apt-get update && apt-get install -y \
|
|
python3 \
|
|
python3-pip \
|
|
ffmpeg \
|
|
cmake \
|
|
build-essential \
|
|
libsdl2-dev \
|
|
libsdl2-ttf-dev \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Copy whisper.cpp
|
|
COPY whisper.cpp-1.5.2 /app/whisper.cpp
|
|
|
|
# Build whisper.cpp
|
|
RUN cd whisper.cpp && \
|
|
mkdir -p build && \
|
|
cd build && \
|
|
cmake .. && \
|
|
make -j$(nproc)
|
|
|
|
# Copy API files
|
|
COPY app.py requirements.txt /app/
|
|
|
|
# Install Python dependencies
|
|
RUN pip install -r requirements.txt
|
|
|
|
# Create data directory
|
|
RUN mkdir /data
|
|
|
|
# Expose port
|
|
EXPOSE 4004
|
|
|
|
# Run the application
|
|
CMD ["python3", "app.py"]
|