Spaces:
Sleeping
Sleeping
File size: 788 Bytes
a31e333 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | # GPU variant -- identical app, CUDA build. Rename to Dockerfile on a GPU Space.
FROM nvidia/cuda:12.1.1-cudnn8-runtime-ubuntu22.04
ENV DEBIAN_FRONTEND=noninteractive PYTHONUNBUFFERED=1
WORKDIR /app
RUN apt-get update && apt-get install -y --no-install-recommends \
python3.10 python3-pip curl git libgomp1 libglib2.0-0 libsm6 libxrender1 libxext6 \
&& rm -rf /var/lib/apt/lists/* \
&& ln -s /usr/bin/python3.10 /usr/bin/python
RUN pip3 install --upgrade pip && \
pip3 install torch torchvision --index-url https://download.pytorch.org/whl/cu121
COPY requirements.txt .
RUN pip3 install -r requirements.txt
COPY app.py index.html ./
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user PATH=/home/user/.local/bin:$PATH
EXPOSE 7860
CMD ["python", "app.py"]
|