Spaces:
Runtime error
Runtime error
# Use an official Python runtime as a parent image | |
FROM python:3.8-slim | |
# Set the working directory in the container | |
WORKDIR /app | |
# Copy the current directory contents into the container at /app | |
COPY . /app | |
# Install system dependencies | |
RUN apt-get update && \ | |
apt-get install -y \ | |
python3-opencv \ | |
libglib2.0-0 \ | |
libsm6 \ | |
libxext6 \ | |
libxrender-dev \ | |
&& rm -rf /var/lib/apt/lists/* | |
# Install dependencies from requirements.txt | |
RUN pip install --upgrade pip | |
RUN pip install -r requirements.txt | |
# Expose port 7860 for Hugging Face Spaces (default port for web apps) | |
EXPOSE 7860 | |
# Command to run the application using Gunicorn | |
CMD ["gunicorn", "-b", "0.0.0.0:7860", "app:app"] | |