Spaces:
Sleeping
Sleeping
| # Use an official Python runtime as a parent image | |
| FROM python:3.10 | |
| # Set environment variables | |
| ENV PYTHONDONTWRITEBYTECODE 1 | |
| ENV PYTHONUNBUFFERED 1 | |
| # Set work directory | |
| WORKDIR /app | |
| # Install system dependencies | |
| # Removed libgl1-mesa-glx as it causes build errors in newer Debian versions | |
| # We use opencv-python-headless which doesn't need it | |
| RUN apt-get update && apt-get install -y \ | |
| gcc \ | |
| libglib2.0-0 \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Install python dependencies | |
| COPY requirements.txt /app/ | |
| RUN pip install --upgrade pip | |
| RUN pip install numpy | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy project | |
| COPY . /app/ | |
| # Expose port 7860 (Hugging Face Default) | |
| EXPOSE 7860 | |
| # Copy and make the start script executable | |
| COPY start.sh /app/ | |
| RUN chmod +x /app/start.sh | |
| # Start using the script | |
| CMD ["/app/start.sh"] | |