Skip to content
Snippets Groups Projects
Select Git revision
  • 970cbcae5dbd61d22809ea088a558ec4f5110531
  • main default protected
2 results

index.php

  • Dockerfile.gpu 1.68 KiB
    FROM onerahmet/ffmpeg:n7.1 AS ffmpeg
    
    FROM swaggerapi/swagger-ui:v5.9.1 AS swagger-ui
    
    FROM nvidia/cuda:12.6.3-cudnn-runtime-ubuntu22.04
    
    ENV PYTHON_VERSION=3.10
    
    RUN export DEBIAN_FRONTEND=noninteractive \
        && apt-get -qq update \
        && apt-get -qq install --no-install-recommends \
        libsndfile1 \
        && rm -rf /var/lib/apt/lists/*
    
    ENV POETRY_VENV=/app/.venv
    
    RUN export DEBIAN_FRONTEND=noninteractive \
        && apt-get -qq update \
        && apt-get -qq install --no-install-recommends \
        python${PYTHON_VERSION} \
        python${PYTHON_VERSION}-venv \
        python3-pip \
        && rm -rf /var/lib/apt/lists/*
    
    RUN ln -s -f /usr/bin/python${PYTHON_VERSION} /usr/bin/python3 && \
        ln -s -f /usr/bin/python${PYTHON_VERSION} /usr/bin/python && \
        ln -s -f /usr/bin/pip3 /usr/bin/pip
    
    RUN python3 -m venv $POETRY_VENV \
        && $POETRY_VENV/bin/pip install -U pip setuptools \
        && $POETRY_VENV/bin/pip install poetry==1.6.1
    
    ENV PATH="${PATH}:${POETRY_VENV}/bin"
    
    WORKDIR /app
    
    COPY poetry.lock pyproject.toml ./
    
    RUN poetry config virtualenvs.in-project true
    RUN poetry install --no-root
    
    COPY . .
    COPY --from=ffmpeg /usr/local/bin/ffmpeg /usr/local/bin/ffmpeg
    COPY --from=swagger-ui /usr/share/nginx/html/swagger-ui.css swagger-ui-assets/swagger-ui.css
    COPY --from=swagger-ui /usr/share/nginx/html/swagger-ui-bundle.js swagger-ui-assets/swagger-ui-bundle.js
    
    RUN poetry install
    RUN $POETRY_VENV/bin/pip install torch==1.13.1+cu117 -f https://download.pytorch.org/whl/torch
    
    RUN $POETRY_VENV/bin/pip install pandas transformers nltk pyannote.audio
    RUN git clone --depth 1 https://github.com/m-bain/whisperX.git \
        && cd whisperX \
        && $POETRY_VENV/bin/pip install -e .
    
    EXPOSE 9000
    
    CMD whisper-asr-webservice