FROM python:3.9-slim # 1) Install dependencies for Dev Mode + Playwright RUN apt-get update && \ apt-get install -y \ bash \ curl \ wget \ procps \ git \ git-lfs \ libnss3 \ libatk1.0-0 \ libatk-bridge2.0-0 \ libx11-6 \ libx11-xcb1 \ libxcomposite1 \ libxcursor1 \ libxdamage1 \ libxext6 \ libxfixes3 \ libxi6 \ libxrandr2 \ libxrender1 \ libxss1 \ libxtst6 \ libappindicator1 \ libsecret-1-0 \ fonts-ipafont-gothic && \ rm -rf /var/lib/apt/lists/* # 2) Copy code into /app WORKDIR /app COPY . /app # 3) Install Python dependencies RUN pip install --upgrade pip RUN pip install gradio RUN pip install -U crawl4ai # 4) Install Playwright browser(s) RUN pip install playwright RUN playwright install --with-deps chrome # 5) Make /app owned by user 1000 (Dev Mode requirement) RUN chown -R 1000 /app # 6) Ensure the HOME variable points to /app (so Git writes to /app/.gitconfig) ENV HOME=/app # 7) Switch to user 1000 USER 1000 # 8) Expose port for Gradio EXPOSE 7860 # 9) Start your Gradio app CMD ["python", "app.py"]