StarrySkyWorld commited on
Commit
d39bd4a
·
verified ·
1 Parent(s): c31d865

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +40 -0
Dockerfile ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM node:20-slim
2
+
3
+ # 设置环境变量
4
+ ENV DEBIAN_FRONTEND=noninteractive
5
+ ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
6
+
7
+ # 安装 Playwright 系统依赖
8
+ RUN apt-get update && apt-get install -y \
9
+ libnss3 \
10
+ libnspr4 \
11
+ libatk1.0-0 \
12
+ libatk-bridge2.0-0 \
13
+ libcups2 \
14
+ libdrm2 \
15
+ libdbus-1-3 \
16
+ libxkbcommon0 \
17
+ libatspi2.0-0 \
18
+ libxcomposite1 \
19
+ libxdamage1 \
20
+ libxfixes3 \
21
+ libxrandr2 \
22
+ libgbm1 \
23
+ libasound2 \
24
+ libpango-1.0-0 \
25
+ libcairo2 \
26
+ fonts-noto-cjk \
27
+ && rm -rf /var/lib/apt/lists/*
28
+
29
+ # 创建工作目录
30
+ WORKDIR /app
31
+
32
+ # 预安装 Playwright MCP 和浏览器
33
+ RUN npx @playwright/mcp@latest --help || true
34
+ RUN npx playwright install chromium
35
+
36
+ # 暴露端口(HuggingFace Spaces 默认使用 7860)
37
+ EXPOSE 7860
38
+
39
+ # 启动 Playwright MCP
40
+ CMD ["npx", "@playwright/mcp@latest", "--port", "7860"]