Spaces:
Sleeping
Sleeping
File size: 842 Bytes
49a5b22 7f146d9 346a803 7f146d9 49a5b22 7f146d9 49a5b22 7f146d9 346a803 7f146d9 346a803 49a5b22 346a803 49a5b22 196756b 49a5b22 196756b 7f146d9 346a803 7f146d9 346a803 7f146d9 8e1e2a3 | 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 36 37 | FROM python:3.11-slim
WORKDIR /app
# 1. Install system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
cmake \
curl \
git \
libopenblas-dev \
liblapack-dev \
&& rm -rf /var/lib/apt/lists/*
# 2. CRITICAL FIX: Limit build to 1 thread to prevent OOM (Exit 137)
ENV CMAKE_BUILD_PARALLEL_LEVEL=1
# 3. Install dlib separately first
RUN pip3 install --no-cache-dir dlib
# 4. Install remaining dependencies
COPY requirements.txt ./
RUN pip3 install --no-cache-dir -r requirements.txt
# 5. Copy source code & startapplicatio.sh script
COPY src/ ./src/
COPY startapplication.sh ./
# Make the script executable
RUN chmod +x startapplication.sh
# 6. Hugging Face Spaces Config
EXPOSE 8501
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
ENTRYPOINT ["./startapplication.sh"] |