Spaces:
Sleeping
Sleeping
File size: 642 Bytes
9b75405 65744f1 9b75405 | 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 | FROM python:3.9-slim
# Install system dependencies required by OpenCV
RUN apt-get update && apt-get install -y \
libglib2.0-0 \
libsm6 \
libxext6 \
libxrender-dev \
&& rm -rf /var/lib/apt/lists/*
# Set up a non-root user for Hugging Face Spaces
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"
WORKDIR /app
# Copy requirements and install
COPY --chown=user requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy the app
COPY --chown=user . .
# Run the app on port 7860 (Hugging Face Spaces default)
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|