Download Dockerfile from sta12/n8n: direct link, hf CLI and curl.
- Browser
- Download file 880 Bytes
-
https://huggingface.co/spaces/sta12/n8n/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/sta12/n8n/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/sta12/n8n/resolve/main/Dockerfile
880 Bytes
| # 使用官方 Node.js 22 镜像作为基础 | |
| FROM node:22 | |
| # 切换到 root 用户 | |
| USER root | |
| # 设置工作目录 | |
| WORKDIR /data | |
| # 安装 tini (一个简单的 init 系统,用于处理信号和僵尸进程) 和 curl (可能需要用于健康检查或调试) | |
| RUN apt-get update && \ | |
| apt-get install -y tini curl sudo --no-install-recommends && \ | |
| rm -rf /var/lib/apt/lists/* | |
| # 全局安装 N8N 最新版本 | |
| # 如果需要特定版本,可以使用 npm install -g n8n@<version> | |
| RUN npm install -g n8n | |
| # 复制启动脚本到容器中 | |
| COPY start.sh /usr/local/bin/start.sh | |
| # 赋予启动脚本执行权限 | |
| RUN chmod +x /usr/local/bin/start.sh | |
| # 设置容器入口点,使用 tini 运行启动脚本 | |
| ENTRYPOINT ["tini", "--"] | |
| # 容器启动时执行的命令 | |
| # 可以通过环境变量 N8N_RUN_WORKER_ONLY=true 来仅启动worker进程 | |
| CMD ["/usr/local/bin/start.sh"] |