mirror of
https://github.com/ahmetoner/whisper-asr-webservice.git
synced 2023-04-14 03:48:29 +03:00
34 lines
1.0 KiB
Docker
34 lines
1.0 KiB
Docker
FROM nvidia/cuda:11.7.0-base-ubuntu22.04
|
|
|
|
ENV PYTHON_VERSION=3.10
|
|
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 \
|
|
ffmpeg \
|
|
&& 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
|
|
|
|
ENV PATH="${PATH}:${POETRY_VENV}/bin"
|
|
|
|
WORKDIR /app
|
|
|
|
COPY . /app
|
|
|
|
RUN poetry config virtualenvs.in-project true
|
|
RUN poetry install
|
|
|
|
RUN $POETRY_VENV/bin/pip install torch==1.13.0+cu117 -f https://download.pytorch.org/whl/torch
|
|
|
|
ENTRYPOINT ["gunicorn", "--bind", "0.0.0.0:9000", "--workers", "1", "--timeout", "0", "app.webservice:app", "-k", "uvicorn.workers.UvicornWorker"] |