|
|
|
FROM pytorch/pytorch:2.2.2-cuda12.1-cudnn8-runtime |
|
|
|
|
|
RUN apt-get update && \ |
|
apt-get install -y --no-install-recommends \ |
|
git-lfs build-essential portaudio19-dev ffmpeg && \ |
|
rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
RUN useradd -m -u 1000 user |
|
USER user |
|
WORKDIR /app |
|
ENV PATH="/home/user/.local/bin:$PATH" |
|
|
|
|
|
COPY --chown=user requirements.txt . |
|
RUN pip install --upgrade pip && \ |
|
pip install --no-cache-dir -r requirements.txt |
|
|
|
|
|
COPY --chown=user . /app |
|
|
|
|
|
RUN pip install --no-cache-dir \ |
|
torch==2.3.1+cu121 torchaudio==2.3.1 \ |
|
--index-url https://download.pytorch.org/whl/cu121 |
|
|
|
EXPOSE 7860 |
|
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] |
|
|