File size: 1,272 Bytes
f813ba1 e409f74 f813ba1 e409f74 f813ba1 e409f74 f813ba1 e409f74 | 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 44 45 | FROM python:3.11-slim
# Metadata
LABEL maintainer="multi-doc-rag"
LABEL description="Multi-Document RAG System - Slim build, no GPU/torch"
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
ENV PIP_NO_CACHE_DIR=1
# Install system dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
curl \
&& rm -rf /var/lib/apt/lists/*
# Set working directory
WORKDIR /app
# Copy requirements first for Docker layer caching
COPY requirements.txt .
# Install Python dependencies (NO torch, NO transformers)
RUN pip install --no-cache-dir -r requirements.txt && \
pip uninstall -y torch torchvision torchaudio transformers sentence-transformers 2>/dev/null || true
# Create upload, evaluation, and log directories with full read/write permissions
# (Crucial for Hugging Face Spaces which runs under user ID 1000)
RUN mkdir -p /app/data/uploads /app/evaluation/reports /app/logs && \
chmod -R 777 /app/data /app/evaluation /app/logs
# Copy application code
COPY . .
# Make the start script executable
RUN chmod +x /app/start.sh
# Expose the default web port (7860 for Hugging Face, 10000 for Render)
EXPOSE 7860
# Run the backend & frontend supervisor script
CMD ["./start.sh"]
|