Spaces:
Runtime error
Runtime error
| FROM python:3.9 | |
| WORKDIR /app | |
| # Install required Python packages | |
| COPY ./requirements.txt requirements.txt | |
| RUN pip install --no-cache-dir --upgrade -r requirements.txt | |
| # Copy application code | |
| COPY app/ app/ | |
| # Create directories for the Hugging Face cache and application data | |
| RUN mkdir -p /app/cache && \ | |
| mkdir -p /app/app/vector_store && \ | |
| mkdir -p /app/app/uploads && \ | |
| mkdir -p /app/app/log_dir && \ | |
| mkdir -p /app/app/models && \ | |
| # Adjust ownership to allow writing | |
| chown -R nobody:nogroup /app/cache && \ | |
| chown -R nobody:nogroup /app/app | |
| # Set environment variable for Hugging Face cache | |
| ENV HF_HOME=/app/cache | |
| # Set to a non-root user | |
| USER nobody | |
| # Define volumes for data persistence | |
| VOLUME /app/app/vector_store | |
| VOLUME /app/app/uploads | |
| VOLUME /app/app/log_dir | |
| VOLUME /app/app/models | |
| VOLUME /app/cache | |
| # Command to run the application | |
| CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"] | |