Spaces:
Runtime error
Runtime error
| FROM python:3.11-slim | |
| # Install system dependencies (required for TensorFlow compilation) | |
| RUN apt-get update && apt-get install -y \ | |
| gcc \ | |
| g++ \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Create user as required by Hugging Face Spaces | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| # Set PATH to include user's local bin | |
| ENV PATH="/home/user/.local/bin:$PATH" | |
| WORKDIR /app | |
| # Copy requirements and install (as user) | |
| COPY --chown=user ./requirements.txt requirements.txt | |
| RUN pip install --no-cache-dir --upgrade -r requirements.txt | |
| # Copy application files (as user) | |
| COPY --chown=user . /app | |
| # Set environment | |
| ENV PYTHONUNBUFFERED=1 | |
| ENV PORT=7860 | |
| # Expose port (Hugging Face Spaces uses 7860) | |
| EXPOSE 7860 | |
| # Run the app | |
| CMD ["python", "app.py"] | |