File size: 526 Bytes
9d932c8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0c56b36
9d932c8
 
0c56b36
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
FROM node:20

WORKDIR /app

# 克隆代码
RUN git clone https://github.com/OpenListTeam/cf-worker-api.git .

# 复制配置文件(从仓库内复制)
RUN cp wrangler.jsonc.example wrangler.jsonc

# 安装依赖
RUN npm install

# 修复权限问题
RUN chmod -R 755 /app && \
    chown -R node:node /app

# 切换到非 root 用户
USER node

# 暴露 Wrangler 开发服务器端口
EXPOSE 7860

# 启动 Wrangler 开发服务器(绑定所有接口)
CMD ["npx", "wrangler", "dev", "--port", "7860", "--ip", "0.0.0.0"]