update
Browse files- Dockerfile +7 -6
Dockerfile
CHANGED
@@ -3,7 +3,7 @@ FROM ubuntu:20.04
|
|
3 |
# 安装基础依赖
|
4 |
RUN apt-get update && apt-get install -y curl ca-certificates openssl
|
5 |
|
6 |
-
# 创建非 root
|
7 |
RUN useradd -m -d /home/node -s /bin/bash node
|
8 |
|
9 |
# 安装 Node.js 18.x
|
@@ -16,15 +16,16 @@ RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \
|
|
16 |
# 全局安装 n8n
|
17 |
RUN npm install -g n8n
|
18 |
|
19 |
-
#
|
|
|
|
|
|
|
|
|
20 |
USER node
|
21 |
ENV HOME=/home/node
|
22 |
WORKDIR $HOME/app
|
23 |
|
24 |
-
#
|
25 |
-
VOLUME $HOME/.n8n
|
26 |
-
|
27 |
-
# 适配 Hugging Face Spaces
|
28 |
ENV PORT=7860
|
29 |
EXPOSE 7860
|
30 |
|
|
|
3 |
# 安装基础依赖
|
4 |
RUN apt-get update && apt-get install -y curl ca-certificates openssl
|
5 |
|
6 |
+
# 创建非 root 用户并设置主目录
|
7 |
RUN useradd -m -d /home/node -s /bin/bash node
|
8 |
|
9 |
# 安装 Node.js 18.x
|
|
|
16 |
# 全局安装 n8n
|
17 |
RUN npm install -g n8n
|
18 |
|
19 |
+
# 修复权限:创建必要目录并赋权
|
20 |
+
RUN mkdir -p /home/node/.n8n /data && \
|
21 |
+
chown -R node:node /home/node/.n8n /data
|
22 |
+
|
23 |
+
# 切换到非 root 用户
|
24 |
USER node
|
25 |
ENV HOME=/home/node
|
26 |
WORKDIR $HOME/app
|
27 |
|
28 |
+
# 暴露端口
|
|
|
|
|
|
|
29 |
ENV PORT=7860
|
30 |
EXPOSE 7860
|
31 |
|