| |
| FROM nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu20.04 |
|
|
| |
| RUN apt-get update && apt-get install -y \ |
| python3.9 \ |
| python3-pip \ |
| && ln -s /usr/bin/python3.9 /usr/bin/python \ |
| && apt-get clean |
|
|
| |
| RUN useradd -m -u 1000 user |
| USER user |
| ENV HOME=/home/user PATH=/home/user/.local/bin:$PATH |
|
|
| |
| WORKDIR /home/user/app |
|
|
| |
| COPY --chown=user ./requirements.txt requirements.txt |
| RUN pip install --no-cache-dir --upgrade -r requirements.txt |
|
|
| |
| COPY --chown=user ./main.py /home/user/app/main.py |
|
|
| |
| EXPOSE 7860 |
|
|
| |
| CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] |