lie-detector / Dockerfile
vaisagan's picture
Fix: add libgles2 and libegl1 for MediaPipe on headless Linux
7ec091d verified
Raw
History Blame Contribute Delete
981 Bytes
# HuggingFace Spaces Dockerfile
# Uses cpu-only torch to avoid CUDA dependency on HF free tier
FROM python:3.11-slim
# System dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
ffmpeg \
libgl1 \
libglib2.0-0 \
libsm6 \
libxext6 \
libxrender-dev \
libgles2 \
libegl1 \
git \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Install Python deps
COPY requirements_hf.txt .
RUN pip install --no-cache-dir -r requirements_hf.txt
# Pre-download Whisper model at build time (avoids cold-start delay)
RUN python -c "import whisper; whisper.load_model('base')"
# Copy project
COPY . .
# HuggingFace Spaces expects port 7860
ENV PORT=7860
EXPOSE 7860
# HuggingFace Spaces: use HF_DEPLOYMENT env var to disable Ollama
ENV HF_DEPLOYMENT=1
CMD ["streamlit", "run", "app/main.py", \
"--server.port=7860", \
"--server.address=0.0.0.0", \
"--server.headless=true", \
"--browser.gatherUsageStats=false"]