|
|
|
FROM nvidia/cuda:11.8.0-cudnn8-devel-ubuntu20.04 |
|
|
|
|
|
WORKDIR /app |
|
|
|
|
|
RUN useradd -m appuser |
|
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive |
|
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \ |
|
python3 \ |
|
python3-pip \ |
|
&& apt-get clean \ |
|
&& rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
COPY ./requirements.txt /app/ |
|
|
|
|
|
RUN chown -R appuser /app |
|
|
|
|
|
USER appuser |
|
|
|
|
|
RUN python3 -m pip install --user --no-cache-dir --upgrade pip && \ |
|
python3 -m pip install --user --no-cache-dir -r requirements.txt uvicorn && \ |
|
hash -r |
|
|
|
|
|
ENV PATH="/home/appuser/.local/bin:${PATH}" |
|
|
|
|
|
|
|
ENV PATH="/home/appuser/.local/bin:/home/appuser/.local/scripts:${PATH}" |
|
|
|
|
|
COPY . /app/ |
|
|
|
|
|
RUN mkdir -p /app/.cache && chmod -R 777 /app/.cache |
|
|
|
|
|
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] |
|
|