HeoooLel commited on
Commit
1c8c5fb
·
verified ·
1 Parent(s): d0c6c68

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +28 -10
Dockerfile CHANGED
@@ -1,18 +1,36 @@
1
- # Use the official Microsoft Playwright image
2
- FROM ://microsoft.com
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
 
4
- # Set work directory
5
  WORKDIR /app
6
 
7
- # Install dependencies
8
- RUN pip install fastapi uvicorn playwright-stealth
9
- RUN playwright install chromium
10
 
11
- # Copy your main.py (make sure you created main.py in the Space too)
12
  COPY . .
13
 
14
- # Hugging Face uses port 7860
15
  EXPOSE 7860
16
 
17
- # Run the API
18
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ # Start with a standard Python 3.9 slim image
2
+ FROM python:3.9-slim
3
+
4
+ # Install system dependencies needed for Playwright
5
+ RUN apt-get update && apt-get install -y \
6
+ wget \
7
+ libnss3 \
8
+ libnspr4 \
9
+ libatk1.0-0 \
10
+ libatk-bridge2.0-0 \
11
+ libcups2 \
12
+ libdrm2 \
13
+ libxkbcommon0 \
14
+ libxcomposite1 \
15
+ libxdamage1 \
16
+ libxext6 \
17
+ libxfixes3 \
18
+ librandr2 \
19
+ libgbm1 \
20
+ libasound2 \
21
+ libpangocairo-1.0-0 \
22
+ libpango-1.0-0 \
23
+ && rm -rf /var/lib/apt/lists/*
24
 
 
25
  WORKDIR /app
26
 
27
+ # Install Python tools
28
+ RUN pip install --no-cache-dir fastapi uvicorn playwright-stealth
29
+ RUN playwright install --with-deps chromium
30
 
 
31
  COPY . .
32
 
33
+ # Hugging Face default port
34
  EXPOSE 7860
35
 
36
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]