# Use a lightweight Python base image FROM python:3.13-slim # Install git and basic dependencies RUN apt-get update && apt-get install -y git --no-install-recommends \ && rm -rf /var/lib/apt/lists/* # Set working directory WORKDIR /app # Clone your GitHub project RUN git clone https://github.com/abubasith456/Ai-Knowledgebase.git . # Move into the 'backend' directory WORKDIR /app/backend # Create directories with proper permissions RUN mkdir -p /temp && chmod -R 777 /temp RUN mkdir -p /.EasyOCR && chmod -R 777 /.EasyOCR RUN mkdir -p /.cache && chmod -R 777 /.cache RUN mkdir -p /.cache/ms-playwright && chmod -R 777 /.cache/ms-playwright # Set environment variables for Playwright ENV PLAYWRIGHT_BROWSERS_PATH=/.cache/ms-playwright ENV PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS=true # Install Python requirements RUN pip install -r requirements.txt # Install Playwright dependencies and browsers as ROOT RUN playwright install-deps RUN playwright install chromium # Verify installation RUN ls -la /.cache/ms-playwright/ || echo "Playwright cache not found" # Start your app CMD ["python", "main.py"]