update
Browse files- Dockerfile +14 -7
Dockerfile
CHANGED
@@ -1,15 +1,22 @@
|
|
1 |
FROM ubuntu:20.04
|
2 |
|
3 |
-
# 安装Node.js
|
4 |
-
RUN apt-get update && apt-get install -y curl
|
5 |
-
RUN curl -
|
6 |
RUN apt-get install -y nodejs
|
7 |
|
8 |
-
#
|
|
|
|
|
|
|
9 |
RUN npm install -g n8n
|
10 |
|
11 |
-
#
|
12 |
-
|
|
|
|
|
|
|
|
|
13 |
|
14 |
# 启动命令
|
15 |
-
CMD ["n8n", "start"]
|
|
|
1 |
FROM ubuntu:20.04
|
2 |
|
3 |
+
# 安装 Node.js 18.x
|
4 |
+
RUN apt-get update && apt-get install -y curl ca-certificates
|
5 |
+
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
|
6 |
RUN apt-get install -y nodejs
|
7 |
|
8 |
+
# 配置 npm 镜像源(可选)
|
9 |
+
RUN npm config set registry https://registry.npmmirror.com
|
10 |
+
|
11 |
+
# 全局安装 n8n
|
12 |
RUN npm install -g n8n
|
13 |
|
14 |
+
# 适配 Hugging Face Spaces 端口
|
15 |
+
ENV PORT=7860
|
16 |
+
EXPOSE 7860
|
17 |
+
|
18 |
+
# 持久化数据卷
|
19 |
+
VOLUME /root/.n8n
|
20 |
|
21 |
# 启动命令
|
22 |
+
CMD ["n8n", "start", "--port", "7860"]
|