Spaces:
Paused
Paused
File size: 887 Bytes
09a64fa f297b77 18a11bc 1fbc3c4 f297b77 18a11bc f297b77 de201ae f297b77 18a11bc a637bd3 f297b77 1fbc3c4 f297b77 | 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 34 35 | FROM python:3.10.7-slim
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1
# Install uv for fast dependency management
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
# Create a non-root user with UID 1000
RUN useradd -m -u 1000 user
WORKDIR /app
COPY --chown=user pyproject.toml uv.lock ./
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
wget \
ca-certificates \
libgl1 \
libglib2.0-0 \
ffmpeg \
&& rm -rf /var/lib/apt/lists/* \
&& uv pip install --system --no-cache -r pyproject.toml \
&& python -c "import transformers; print('transformers', transformers.__version__); print('has Sam2Model', hasattr(transformers, 'Sam2Model'))"
COPY --chown=user . .
USER user
ENV HOME=/home/user
ENV PATH=/home/user/.local/bin:$PATH
EXPOSE 7860
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|