topGdev commited on
Commit
88772b5
·
1 Parent(s): 2f36c8b

Add Playwright system dependencies

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -6
Dockerfile CHANGED
@@ -3,8 +3,15 @@
3
 
4
  FROM python:3.12-slim-bullseye
5
 
6
- # Update system packages to patch vulnerabilities
7
- RUN apt-get update && apt-get upgrade -y && rm -rf /var/lib/apt/lists/*
 
 
 
 
 
 
 
8
 
9
  # Create non-root user for security
10
  RUN useradd -m -u 1000 user
@@ -17,15 +24,15 @@ WORKDIR /app
17
  COPY --chown=user ./requirements.txt requirements.txt
18
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
19
 
 
 
 
20
  # Download NLTK data
21
  RUN python -m nltk.downloader stopwords wordnet punkt_tab
22
 
23
- # Install Playwright browsers
24
  RUN playwright install chromium
25
 
26
- # Copy application code
27
- COPY --chown=user . /app
28
-
29
  # Expose port (HF Spaces uses 7860)
30
  EXPOSE 7860
31
 
 
3
 
4
  FROM python:3.12-slim-bullseye
5
 
6
+ # Update system packages and install Playwright dependencies
7
+ RUN apt-get update && apt-get upgrade -y && \
8
+ apt-get install -y --no-install-recommends \
9
+ libglib2.0-0 libgobject-2.0-0 libnspr4 libnss3 libnssutil3 libsmime3 \
10
+ libgio-2.0-0 libdbus-1-3 libatk-1.0-0 libatk-bridge-2.0-0 libcups2 \
11
+ libexpat1 libxcb1 libxkbcommon0 libatspi2.0-0 libx11-6 libxcomposite1 \
12
+ libxdamage1 libxext6 libxfixes3 libxrandr2 libgbm1 libcairo2 libpango-1.0-0 \
13
+ libasound2 && \
14
+ rm -rf /var/lib/apt/lists/*
15
 
16
  # Create non-root user for security
17
  RUN useradd -m -u 1000 user
 
24
  COPY --chown=user ./requirements.txt requirements.txt
25
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
26
 
27
+ # Copy application code first
28
+ COPY --chown=user . /app
29
+
30
  # Download NLTK data
31
  RUN python -m nltk.downloader stopwords wordnet punkt_tab
32
 
33
+ # Install Playwright browsers (after app is copied)
34
  RUN playwright install chromium
35
 
 
 
 
36
  # Expose port (HF Spaces uses 7860)
37
  EXPOSE 7860
38