Auto Deployer
Fix build error: Upgrade to Node 20 and install python/make for better-sqlite3
2fbd62d Download Dockerfile from luoleyuan/agent01: direct link, hf CLI and curl.
- Browser
- Download file 568 Bytes
-
https://huggingface.co/spaces/luoleyuan/agent01/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/luoleyuan/agent01/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/luoleyuan/agent01/resolve/main/Dockerfile
568 Bytes
| # 1. 使用 Node.js 20 基础镜像 (解决 cheerio 等依赖的 Node 版本要求) | |
| FROM node:20-alpine | |
| # 2. 安装 Python 和构建工具 (解决 better-sqlite3 在 alpine 下的 node-gyp 编译问题) | |
| RUN apk add --no-cache python3 make g++ gcc | |
| # 3. 设置工作目录 | |
| WORKDIR /app | |
| # 4. 复制 package.json 并安装依赖 | |
| COPY package*.json ./ | |
| RUN npm install | |
| # 5. 复制项目源代码 | |
| COPY . . | |
| # 6. 编译 TypeScript 代码 | |
| RUN npm run build | |
| # 7. Hugging Face Spaces 默认暴露 7860 端口 | |
| ENV PORT=7860 | |
| EXPOSE 7860 | |
| # 8. 启动服务 | |
| CMD ["npm", "start"] |