File size: 1,180 Bytes
ae95bfb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
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"]