Rivalcoder commited on
Commit
540d948
·
1 Parent(s): a745352

Use of Playright

Browse files
Files changed (2) hide show
  1. Dockerfile +27 -2
  2. requirements.txt +1 -0
Dockerfile CHANGED
@@ -4,14 +4,39 @@ FROM python:3.11-slim
4
  # Set working directory
5
  WORKDIR /app
6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  # Copy requirements and install
8
  COPY requirements.txt .
9
  RUN pip install --no-cache-dir -r requirements.txt
10
 
11
- # Copy all files
 
 
 
12
  COPY . .
13
 
14
- # Expose port for HF Spaces
15
  EXPOSE 7860
16
 
17
  # Run FastAPI via Uvicorn
 
4
  # Set working directory
5
  WORKDIR /app
6
 
7
+ # Install system dependencies required by Playwright and Chromium
8
+ RUN apt-get update && apt-get install -y \
9
+ curl \
10
+ gnupg \
11
+ ca-certificates \
12
+ libnss3 \
13
+ libatk1.0-0 \
14
+ libatk-bridge2.0-0 \
15
+ libcups2 \
16
+ libx11-xcb1 \
17
+ libxcomposite1 \
18
+ libxdamage1 \
19
+ libxrandr2 \
20
+ libgbm1 \
21
+ libpango-1.0-0 \
22
+ libpangocairo-1.0-0 \
23
+ libasound2 \
24
+ fonts-liberation \
25
+ libglib2.0-0 \
26
+ libdrm2 \
27
+ && rm -rf /var/lib/apt/lists/*
28
+
29
  # Copy requirements and install
30
  COPY requirements.txt .
31
  RUN pip install --no-cache-dir -r requirements.txt
32
 
33
+ # Install Playwright browsers
34
+ RUN playwright install --with-deps chromium
35
+
36
+ # Copy all app files
37
  COPY . .
38
 
39
+ # Expose port for FastAPI / HF Spaces
40
  EXPOSE 7860
41
 
42
  # Run FastAPI via Uvicorn
requirements.txt CHANGED
@@ -7,3 +7,4 @@ langchain
7
  langchain-community
8
  faiss-cpu
9
  google-genai
 
 
7
  langchain-community
8
  faiss-cpu
9
  google-genai
10
+ playwright