Spaces:
Sleeping
Sleeping
| FROM python:3.9-slim | |
| # Create a non-root user with UID 1000 | |
| RUN useradd -m -u 1000 user | |
| # Set working directory | |
| RUN mkdir templates | |
| RUN mkdir static | |
| WORKDIR /app | |
| RUN mkdir -p /app/static/plots && chown -R user:user /app/static | |
| # Copy dependencies and install | |
| COPY --chown=user requirements.txt . | |
| RUN pip install --no-cache-dir --upgrade -r requirements.txt | |
| # Copy the full app | |
| COPY --chown=user . . | |
| # Switch to non-root user | |
| USER user | |
| # Expose port Hugging Face expects | |
| EXPOSE 7860 | |
| # Run Flask app using Gunicorn on port 7860 | |
| CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app:app"] | |