Spaces:
Sleeping
Sleeping
File size: 613 Bytes
2ebe4b1 | 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 | FROM python:3.10-slim
# System deps for opencv-headless and torch
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
libgl1 \
libglib2.0-0 \
git \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Tell torch.hub where to cache DINOv2 so it persists across rebuilds
ENV TORCH_HOME=/app/.torch_cache
ENV HF_HOME=/app/.hf_cache
COPY requirements.txt .
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
COPY . .
EXPOSE 7860
CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "7860"]
|