| FROM nvidia/cuda:11.7.1-cudnn8-runtime-ubuntu20.04 | |
| ENV DEBIAN_FRONTEND=noninteractive | |
| RUN apt update && \ | |
| apt install -y bash \ | |
| build-essential \ | |
| git \ | |
| git-lfs \ | |
| curl \ | |
| ca-certificates \ | |
| libsndfile1-dev \ | |
| libgl1 \ | |
| python3.8 \ | |
| python3-pip \ | |
| python3.8-venv && \ | |
| rm -rf /var/lib/apt/lists | |
| WORKDIR /code | |
| COPY ./requirements.txt /code/requirements.txt | |
| RUN python3 -m pip install --no-cache-dir --upgrade pip && \ | |
| python3 -m pip install --no-cache-dir --upgrade -r /code/requirements.txt | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| ENV HOME=/home/user \ | |
| PATH=/home/user/.local/bin:$PATH | |
| WORKDIR $HOME/server | |
| COPY --chown=user . $HOME/server | |
| CMD ["uvicorn", "api.main:api", "--host", "0.0.0.0", "--port", "7860"] |