Skip to content

Commit 7fc019d

Browse files
committed
feat: add browser dependeny in docker image
1 parent 3836cea commit 7fc019d

File tree

2 files changed

+50
-8
lines changed

2 files changed

+50
-8
lines changed

docker/Dockerfile

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,55 @@ FROM python:3.11-slim
22

33
WORKDIR /app
44

5+
# Install system dependencies for Playwright
6+
RUN apt-get update && apt-get install -y --no-install-recommends \
7+
wget \
8+
gnupg \
9+
ca-certificates \
10+
curl \
11+
libglib2.0-0 \
12+
libnss3 \
13+
libnspr4 \
14+
libatk1.0-0 \
15+
libatk-bridge2.0-0 \
16+
libcups2 \
17+
libdrm2 \
18+
libdbus-1-3 \
19+
libxcb1 \
20+
libxkbcommon0 \
21+
libx11-6 \
22+
libxcomposite1 \
23+
libxdamage1 \
24+
libxext6 \
25+
libxfixes3 \
26+
libxrandr2 \
27+
libgbm1 \
28+
libpango-1.0-0 \
29+
libcairo2 \
30+
libasound2 \
31+
libatspi2.0-0 \
32+
libwayland-client0 \
33+
&& rm -rf /var/lib/apt/lists/*
34+
35+
# Copy requirements files first for better layer caching
36+
COPY requirements.txt requirements-optional.txt /app/
37+
38+
# Install required and optional dependencies
39+
RUN pip install --no-cache-dir -r requirements.txt && \
40+
pip install --no-cache-dir -r requirements-optional.txt
41+
42+
# Install Playwright
43+
RUN pip install --no-cache-dir playwright && \
44+
playwright install --with-deps chromium
45+
546
# Copy project files
647
COPY . /app/
748

849
# Copy and make entrypoint script executable
950
COPY docker/entrypoint.sh /app/
1051
RUN chmod +x /app/entrypoint.sh
1152

12-
# Install dependencies
53+
# Install the package itself
1354
RUN pip install --no-cache-dir -e .
1455

1556
# Create configuration directory
@@ -18,6 +59,8 @@ RUN mkdir -p /config
1859
# Set environment variables
1960
ENV CONFIG_PATH=/app/config.yaml
2061
ENV DOCKER_CONTAINER=true
62+
# Set Playwright environment variables
63+
ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
2164

2265
# Set entrypoint
2366
CMD ["/app/entrypoint.sh"]

setup.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@
55
with open("README.md", "r", encoding="utf-8") as fh:
66
long_description = fh.read()
77

8+
# 读取 requirements.txt
9+
with open('requirements.txt') as f:
10+
requirements = f.read().splitlines()
11+
812
setup(
913
name="agentmesh-sdk",
10-
version="0.0.1.dev2",
14+
version="0.0.1.dev3",
1115
author="Minimal Future",
1216
author_email="zyj@zhayujie.com",
1317
description="An open-source multi-agent framework for building agent teams with LLMs",
@@ -25,12 +29,7 @@
2529
"Topic :: Scientific/Engineering :: Artificial Intelligence",
2630
],
2731
python_requires=">=3.7",
28-
install_requires=[
29-
"urllib3",
30-
"requests",
31-
"pyyaml",
32-
"pydantic"
33-
],
32+
install_requires=requirements,
3433
extras_require={
3534
"full": ["browser-use>=0.1.40"],
3635
},

0 commit comments

Comments
 (0)