Commit
·
e521b70
1
Parent(s):
4389e63
update api handle 3
Browse files- Dockerfile +20 -4
Dockerfile
CHANGED
@@ -2,10 +2,27 @@ FROM python:3.10-slim
|
|
2 |
|
3 |
WORKDIR /code
|
4 |
|
5 |
-
# Install system dependencies
|
6 |
RUN apt-get update && apt-get install -y \
|
7 |
wget \
|
8 |
gnupg \
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
&& mkdir -p /etc/apt/sources.list.d \
|
10 |
&& wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | gpg --dearmor > /etc/apt/trusted.gpg.d/google.gpg \
|
11 |
&& echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google.list \
|
@@ -24,10 +41,9 @@ USER myuser
|
|
24 |
COPY requirements.txt .
|
25 |
RUN pip install --no-cache-dir -r requirements.txt
|
26 |
|
27 |
-
# Install playwright and
|
28 |
RUN pip install --user playwright && \
|
29 |
-
python -m playwright install
|
30 |
-
python -m playwright install-deps
|
31 |
|
32 |
# Copy application code
|
33 |
COPY app.py .
|
|
|
2 |
|
3 |
WORKDIR /code
|
4 |
|
5 |
+
# Install system dependencies and playwright dependencies as root
|
6 |
RUN apt-get update && apt-get install -y \
|
7 |
wget \
|
8 |
gnupg \
|
9 |
+
xvfb \
|
10 |
+
libgbm1 \
|
11 |
+
libnss3 \
|
12 |
+
libnspr4 \
|
13 |
+
libxss1 \
|
14 |
+
libasound2 \
|
15 |
+
libatk1.0-0 \
|
16 |
+
libatk-bridge2.0-0 \
|
17 |
+
libdrm2 \
|
18 |
+
libgtk-3-0 \
|
19 |
+
libxkbcommon0 \
|
20 |
+
libxcomposite1 \
|
21 |
+
libxdamage1 \
|
22 |
+
libxfixes3 \
|
23 |
+
libxrandr2 \
|
24 |
+
libpango-1.0-0 \
|
25 |
+
libcairo2 \
|
26 |
&& mkdir -p /etc/apt/sources.list.d \
|
27 |
&& wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | gpg --dearmor > /etc/apt/trusted.gpg.d/google.gpg \
|
28 |
&& echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google.list \
|
|
|
41 |
COPY requirements.txt .
|
42 |
RUN pip install --no-cache-dir -r requirements.txt
|
43 |
|
44 |
+
# Install playwright and chromium browser only (no system dependencies)
|
45 |
RUN pip install --user playwright && \
|
46 |
+
python -m playwright install chromium
|
|
|
47 |
|
48 |
# Copy application code
|
49 |
COPY app.py .
|