aripbae commited on
Commit
fe8ebe3
·
verified ·
1 Parent(s): 4cc426f

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +56 -1
Dockerfile CHANGED
@@ -1 +1,56 @@
1
- FROM langflowai/langflow:latest
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # 基础镜像:使用 Node.js 20 的 Alpine Linux 版本
2
+ FROM node:20-alpine
3
+
4
+ # 设置工作目录
5
+ WORKDIR /app
6
+
7
+ # 安装系统依赖
8
+ RUN apk add --no-cache \
9
+ # 基本构建工具
10
+ python3 \
11
+ make \
12
+ g++ \
13
+ git \
14
+ # Playwright 依赖
15
+ chromium \
16
+ nss \
17
+ freetype \
18
+ freetype-dev \
19
+ harfbuzz \
20
+ ca-certificates \
21
+ ttf-freefont \
22
+ # 其他依赖
23
+ gcompat
24
+
25
+ # 设置 Playwright 的环境变量
26
+ ENV PLAYWRIGHT_BROWSERS_PATH /usr/bin \
27
+ PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD 1 \
28
+ PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH /usr/bin/chromium-browser \
29
+ PLAYWRIGHT_SKIP_BROWSER_VALIDATION=1
30
+
31
+ # 复制依赖文件并安装
32
+ RUN git clone https://github.com/zhezzma/playwright-proxy .
33
+ COPY package*.json tsconfig.json ./
34
+ RUN npm install
35
+
36
+ # 复制源代码和静态文件
37
+ COPY src/ ./src/
38
+ COPY index.html ./index.html
39
+ RUN npm run build
40
+
41
+ # 创建非 root 用户和用户组
42
+ RUN addgroup -S -g 1001 nodejs && \
43
+ adduser -S -D -H -u 1001 -G nodejs hono
44
+
45
+ # 设置应用文件的所有权
46
+ RUN chown -R hono:nodejs /app
47
+
48
+ # 切换到非 root 用户
49
+ USER hono
50
+
51
+ # 声明容器要暴露的端口
52
+ EXPOSE 7860
53
+ ENV PORT 7860
54
+
55
+ # 启动应用
56
+ CMD ["node", "dist/index.js"]