|
|
|
FROM nvidia/cuda:11.8.0-runtime-ubuntu20.04 |
|
|
|
|
|
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8 |
|
ENV PATH="/home/user/.local/bin:$PATH" |
|
|
|
|
|
RUN apt-get update && apt-get install -y \ |
|
python3 \ |
|
python3-pip \ |
|
python3-dev \ |
|
libgl1-mesa-glx \ |
|
libglib2.0-0 \ |
|
&& apt-get clean && rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
RUN useradd -m user |
|
|
|
|
|
USER user |
|
|
|
|
|
WORKDIR /app |
|
|
|
|
|
COPY --chown=user requirements.txt /app/requirements.txt |
|
RUN pip3 install --no-cache-dir --upgrade -r /app/requirements.txt |
|
|
|
|
|
COPY --chown=user . /app |
|
|
|
|
|
RUN mkdir -p /app/static/uploads /app/static/results && \ |
|
chmod -R 755 /app/static/uploads /app/static/results |
|
|
|
|
|
EXPOSE 7860 |
|
|
|
|
|
CMD ["python3", "-m", "uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] |
|
|