Spaces:
Runtime error
Runtime error
| FROM python:3.12-slim | |
| WORKDIR /code | |
| # Install system dependencies | |
| RUN apt-get update && apt-get install -y \ | |
| build-essential \ | |
| libpoppler-cpp-dev \ | |
| pkg-config \ | |
| libgl1-mesa-glx \ | |
| libglib2.0-0 \ | |
| libsm6 \ | |
| libxext6 \ | |
| libxrender-dev \ | |
| libopencv-dev \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Create non-root user first | |
| RUN useradd -m appuser | |
| # Create necessary directories from Config | |
| RUN mkdir -p /code/data/documents/pdfs \ | |
| /code/data/documents/presentations \ | |
| /code/data/documents/excel \ | |
| /code/data/logs \ | |
| /code/data/cache \ | |
| /code/data/temp \ | |
| /code/data/stored_images \ | |
| /code/data/local_qdrant \ | |
| && chown -R appuser:appuser /code | |
| # Copy requirements and install | |
| COPY --chown=appuser:appuser requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy application files with correct ownership | |
| COPY --chown=appuser:appuser . . | |
| # Switch to non-root user | |
| USER appuser | |
| CMD ["python", "app.py"] |