Spaces:
Runtime error
Runtime error
File size: 1,123 Bytes
ecf18d6 ec2aa33 975d1b2 9cb30e2 ec2aa33 ecf18d6 4a2d6e9 ecf18d6 83a3988 c40f821 4ad299d c40f821 ecf18d6 9cb30e2 4ad299d 9cb30e2 ecf18d6 c7e2b56 ecf18d6 975d1b2 ec2aa33 975d1b2 db8326c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# Use the official Python 3.11 slim image
FROM python:3.11-slim
# Set environment variables
ENV DEBIAN_FRONTEND=noninteractive
ENV PYTHONUNBUFFERED=1
# Install basic build tools and libraries (required by faiss-cpu, PyMuPDF, etc.)
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
cmake \
libopenblas-dev \
libomp-dev \
poppler-utils \
&& rm -rf /var/lib/apt/lists/*
# Create a working directory
WORKDIR /app
# Set Hugging Face cache directory
ENV HF_HOME=/app/cache
RUN mkdir -p /app/cache && chmod -R 777 /app/cache
# Copy requirements first (for Docker layer caching)
COPY requirements.txt .
# Install Python dependencies (no version pinning)
RUN pip install --no-cache-dir -r requirements.txt
# Create directories with proper read/write permissions
RUN mkdir -p /app/uploads/vectors && chmod -R 777 /app/uploads
# Copy the rest of the application files
COPY . .
# Expose the port used by your Flask app (e.g., 7860)
EXPOSE 7860
# Start the Flask app
#CMD ["python", "run.py"]
# Run Gunicorn
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "wsgi:obj_app"]
|