Spaces:
Running
Running
| FROM python:3.11-slim | |
| WORKDIR /app | |
| # Install system dependencies | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| libgomp1 \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Copy requirements and install Python dependencies | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt gunicorn | |
| # Copy application files | |
| COPY app.py model.py best_model.pth ./ | |
| # Expose port (internal, Nginx will handle external HTTPS) | |
| EXPOSE 8000 | |
| # Run with Gunicorn (production WSGI server) | |
| CMD ["gunicorn", "-w", "1", "-b", "0.0.0.0:8000", "--timeout", "300", "--access-logfile", "-", "--error-logfile", "-", "app:app"] | |