FROM python:3.11-slim WORKDIR /app # Install system dependencies RUN apt-get update && apt-get install -y \ build-essential \ curl \ && rm -rf /var/lib/apt/lists/* # Copy requirements first COPY requirements.txt . # Install Python dependencies RUN pip install --no-cache-dir --upgrade pip RUN pip install --no-cache-dir -r requirements.txt # Copy application code COPY . . # Create necessary directories with proper permissions and ownership RUN mkdir -p /app/lightrag_storage/fire_safety && \ mkdir -p /app/lightrag_storage/custom && \ mkdir -p /app/user_data && \ chmod -R 777 /app/lightrag_storage && \ chmod -R 777 /app/user_data && \ chown -R root:root /app/lightrag_storage && \ chown -R root:root /app/user_data # Set environment variables ENV PYTHONPATH=/app ENV PYTHONUNBUFFERED=1 # Expose port EXPOSE 7860 # Run the application CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]