Spaces:
Sleeping
Sleeping
File size: 842 Bytes
eebd638 | 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 27 28 29 30 31 32 33 | FROM python:3.11-slim
WORKDIR /app
# System deps — GDAL, OpenCV, build tools
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc g++ \
libgdal-dev gdal-bin \
libspatialindex-dev \
libglib2.0-0 libsm6 libxrender1 libxext6 \
git curl \
&& rm -rf /var/lib/apt/lists/*
# Torch with CUDA 12.1 (separate layer for better caching)
RUN pip install --no-cache-dir \
torch torchvision \
--index-url https://download.pytorch.org/whl/cu121
# App dependencies
COPY requirements_hf.txt .
RUN pip install --no-cache-dir -r requirements_hf.txt
# Copy application
COPY . .
# HF Spaces requires port 7860
EXPOSE 7860
ENV PYTHONPATH=/app \
HF_HOME=/app/.cache/huggingface
CMD ["python", "-m", "uvicorn", "dashboard.app:app", "--host", "0.0.0.0", "--port", "7860"]
|