|
|
|
FROM python:3.12.2 |
|
|
|
|
|
RUN useradd -m -u 1000 user |
|
|
|
|
|
WORKDIR /app |
|
|
|
|
|
COPY --chown=user . /app/ |
|
USER root |
|
|
|
RUN apt-get update && apt-get install git -y |
|
RUN pip3 install "git+https://github.com/openai/whisper.git" |
|
RUN apt-get update && apt-get install -y ffmpeg |
|
|
|
|
|
RUN pip install --no-cache-dir -U pip setuptools wheel |
|
RUN pip install --no-cache-dir setuptools-rust |
|
RUN pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu |
|
RUN pip install --no-cache-dir -r requirements.txt |
|
|
|
|
|
|
|
ENV TORCH_DEVICE="cuda" |
|
ENV FORCE_FP32="false" |
|
|
|
|
|
EXPOSE 7860 |
|
|
|
|
|
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "5"] |