Spaces:
Running
Running
| # 1. Start with a lightweight Python image | |
| FROM python:3.10-slim | |
| # 2. Set the directory inside the cloud server | |
| WORKDIR /app | |
| # 3. Install required system libraries for OpenCV to work in the cloud | |
| RUN apt-get update && apt-get install -y libgl1 libglib2.0-0 | |
| # 4. Copy your requirements file and install the Python libraries | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # 5. Copy all your project files (app.py, templates, models, etc.) | |
| COPY . . | |
| # 6. Hugging Face exposes port 7860 by default | |
| EXPOSE 7860 | |
| # 7. Start the Flask server using Gunicorn (production-ready) | |
| CMD ["gunicorn", "-b", "0.0.0.0:7860", "--timeout", "120", "server:app"] |