Spaces:
Runtime error
Runtime error
| FROM python:3.10-slim | |
| # Install system dependencies | |
| RUN apt-get update && \ | |
| apt-get install -y --no-install-recommends \ | |
| curl \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Set working directory | |
| WORKDIR /app | |
| # Set environment variables | |
| ENV PYTHONUNBUFFERED=1 \ | |
| PYTHONDONTWRITEBYTECODE=1 \ | |
| UPLOAD_FOLDER=/tmp/pdf_uploads \ | |
| OUTPUT_FOLDER=/tmp/pdf_output | |
| # Create necessary directories and set permissions | |
| RUN mkdir -p /tmp/pdf_uploads /tmp/pdf_output \ | |
| && chmod -R 777 /tmp/pdf_uploads /tmp/pdf_output | |
| # Copy requirements and app files | |
| COPY requirements.txt /app/ | |
| COPY *.py /app/ | |
| COPY entrypoint.sh /app/ | |
| RUN chmod +x /app/entrypoint.sh | |
| # Install Python dependencies | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Expose port | |
| EXPOSE 7860 | |
| # Set the entrypoint | |
| ENTRYPOINT ["/app/entrypoint.sh"] |