|
FROM docker.io/nvidia/cuda:11.8.0-cudnn8-devel-ubuntu22.04@sha256:8f9dd0d09d3ad3900357a1cf7f887888b5b74056636cd6ef03c160c3cd4b1d95 |
|
|
|
RUN apt-get update && apt-get install -y python3 python3-pip |
|
|
|
WORKDIR /code |
|
|
|
COPY ./requirements.txt /code/requirements.txt |
|
|
|
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt |
|
|
|
|
|
RUN pip install --no-cache-dir torch torchvision |
|
|
|
|
|
COPY gpu_check.py /code/gpu_check.py |
|
RUN python3 /code/gpu_check.py |
|
|
|
|
|
RUN useradd -m -u 1000 user |
|
|
|
|
|
USER user |
|
|
|
|
|
ENV HOME=/home/user \ |
|
PATH=/home/user/.local/bin:$PATH |
|
|
|
|
|
WORKDIR $HOME/app |
|
|
|
|
|
COPY --chown=user . $HOME/app |
|
|
|
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] |
|
|
|
|