|
ARG BASE=nvidia/cuda:11.8.0-base-ubuntu22.04 |
|
FROM ${BASE} |
|
|
|
|
|
RUN apt-get update && apt-get upgrade -y \ |
|
&& apt-get install -y --no-install-recommends \ |
|
gcc g++ \ |
|
make \ |
|
python3 python3-dev python3-pip python3-venv python3-wheel \ |
|
espeak-ng libsndfile1-dev \ |
|
git \ |
|
cuda-toolkit-11-8 \ |
|
&& rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
RUN pip3 install llvmlite --ignore-installed \ |
|
&& pip3 install torch torchaudio numpy --extra-index-url https://download.pytorch.org/whl/cu118 \ |
|
&& rm -rf /root/.cache/pip |
|
|
|
|
|
WORKDIR /app |
|
|
|
|
|
COPY . . |
|
|
|
|
|
RUN pip install --no-cache-dir -r requirements.txt |
|
|
|
|
|
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] |
|
|