StarrySkyWorld commited on
Commit
07ed2db
·
verified ·
1 Parent(s): 2a8e7fa

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -22
Dockerfile CHANGED
@@ -3,35 +3,22 @@ FROM node:20-slim
3
  ENV DEBIAN_FRONTEND=noninteractive
4
  ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
5
 
6
- # 安装 Playwright 系统依赖
7
  RUN apt-get update && apt-get install -y \
8
- libnss3 \
9
- libnspr4 \
10
- libatk1.0-0 \
11
- libatk-bridge2.0-0 \
12
- libcups2 \
13
- libdrm2 \
14
- libdbus-1-3 \
15
- libxkbcommon0 \
16
- libatspi2.0-0 \
17
- libxcomposite1 \
18
- libxdamage1 \
19
- libxfixes3 \
20
- libxrandr2 \
21
- libgbm1 \
22
- libasound2 \
23
- libpango-1.0-0 \
24
- libcairo2 \
25
- fonts-noto-cjk \
26
  && rm -rf /var/lib/apt/lists/*
27
 
28
  WORKDIR /app
29
 
30
- # 安装 Playwright MCP 和浏览器
31
  RUN npm install @playwright/mcp@latest
32
  RUN npx playwright install chromium
33
 
 
 
 
34
  EXPOSE 7860
35
 
36
- # 关键:添加 --host --allowed-origins 参数
37
- CMD ["npx", "@playwright/mcp@latest", "--host", "0.0.0.0", "--port", "7860", "--allowed-origins", "*"]
 
3
  ENV DEBIAN_FRONTEND=noninteractive
4
  ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
5
 
 
6
  RUN apt-get update && apt-get install -y \
7
+ libnss3 libnspr4 libatk1.0-0 libatk-bridge2.0-0 \
8
+ libcups2 libdrm2 libdbus-1-3 libxkbcommon0 \
9
+ libatspi2.0-0 libxcomposite1 libxdamage1 libxfixes3 \
10
+ libxrandr2 libgbm1 libasound2 libpango-1.0-0 \
11
+ libcairo2 fonts-noto-cjk \
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  && rm -rf /var/lib/apt/lists/*
13
 
14
  WORKDIR /app
15
 
 
16
  RUN npm install @playwright/mcp@latest
17
  RUN npx playwright install chromium
18
 
19
+ # 复制配置文件
20
+ COPY config.json /app/config.json
21
+
22
  EXPOSE 7860
23
 
24
+ CMD ["npx", "@playwright/mcp@latest", "--config", "/app/config.json"]