| FROM python:3.13.5-slim | |
| # Create non-root user (HF requirement) | |
| RUN useradd -m -u 1000 user | |
| # Set work directory | |
| WORKDIR /home/user/app | |
| # Copy requirements first (better cache) | |
| COPY requirements.txt . | |
| # Install dependencies | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy project files | |
| COPY . . | |
| # Switch to non-root user | |
| USER user | |
| # Expose HF port | |
| EXPOSE 7860 | |
| # Run Django with Gunicorn (PRODUCTION SAFE) | |
| CMD ["daphne", "devnoms.asgi:application", "--bind", "0.0.0.0","--port" , "7860"] | |