Spaces:
Runtime error
Runtime error
| # Use the official Python 3.10.9 image | |
| FROM python:3.10.9 | |
| # Install wkhtmltopdf and its dependencies | |
| RUN apt-get update && apt-get install -y \ | |
| wkhtmltopdf \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Set the working directory | |
| WORKDIR /app | |
| # Copy the current directory contents into the container | |
| COPY . . | |
| # Install requirements | |
| RUN pip install --no-cache-dir --upgrade -r requirements.txt | |
| # Ensure the correct permissions for hrequests library path | |
| RUN chmod -R a+w /usr/local/lib/python3.10/site-packages/hrequests/bin/ | |
| # Start the FastAPI app on port 7860, the default port expected by Spaces | |
| CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] |