surprise-backend / Dockerfile
khu
Fix: use libgl1 instead of obsolete libgl1-mesa-glx
e23ce90
Raw
History Blame Contribute Delete
536 Bytes
FROM python:3.10-slim
WORKDIR /app
# System dependencies for OpenCV + ffmpeg (video decoding)
RUN apt-get update && apt-get install -y --no-install-recommends \
libgl1 \
libglib2.0-0 \
ffmpeg \
&& rm -rf /var/lib/apt/lists/*
# Python deps first (better Docker layer caching)
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# App code
COPY . .
# HF Spaces requires apps to listen on port 7860
ENV PORT=7860
EXPOSE 7860
CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "7860"]