Update Dockerfile
Browse files- Dockerfile +23 -28
Dockerfile
CHANGED
@@ -1,34 +1,29 @@
|
|
1 |
-
|
|
|
2 |
|
3 |
-
|
|
|
4 |
|
5 |
-
|
6 |
-
RUN
|
7 |
|
8 |
-
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
rm -rf /root/.npm
|
18 |
|
19 |
-
|
20 |
-
|
21 |
-
RUN npm install n8n-nodes-browserless
|
22 |
-
RUN ls -lah
|
23 |
|
24 |
-
#
|
25 |
-
|
26 |
-
RUN apk --no-cache add tini
|
27 |
-
COPY docker-entrypoint.sh /docker-entrypoint.sh
|
28 |
-
RUN chmod +x /docker-entrypoint.sh
|
29 |
-
RUN chmod 777 /usr/local/lib/node_modules
|
30 |
-
RUN chmod -R 777 /home/node/.n8n/nodes
|
31 |
-
ENTRYPOINT ["tini", "--", "/docker-entrypoint.sh"]
|
32 |
-
|
33 |
-
# 默认用户切换
|
34 |
-
USER node
|
|
|
1 |
+
# 使用官方的 Node.js 镜像,基于 Debian Slim 版本,更加精简
|
2 |
+
FROM node:slim
|
3 |
|
4 |
+
# 设置工作目录
|
5 |
+
WORKDIR /home/node/app
|
6 |
|
7 |
+
# 全局安装 n8n
|
8 |
+
RUN npm install n8n -g
|
9 |
|
10 |
+
# 设置环境变量,包括时区设置
|
11 |
+
ENV N8N_HOST=0.0.0.0
|
12 |
+
ENV N8N_PORT=5678
|
13 |
+
ENV N8N_PROTOCOL=https
|
14 |
+
ENV WEBHOOK_URL=https://hijnu-n8n.hf.space/
|
15 |
+
ENV GENERIC_TIMEZONE=Asia/Shanghai
|
16 |
|
17 |
+
# 安装 tzdata 包以支持时区设置
|
18 |
+
RUN apt-get update && \
|
19 |
+
apt-get install -y tzdata && \
|
20 |
+
ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
|
21 |
+
dpkg-reconfigure --frontend noninteractive tzdata && \
|
22 |
+
apt-get clean && \
|
23 |
+
rm -rf /var/lib/apt/lists/*
|
|
|
24 |
|
25 |
+
# 暴露 n8n 端口
|
26 |
+
EXPOSE 5678
|
|
|
|
|
27 |
|
28 |
+
# 启动 n8n
|
29 |
+
CMD ["n8n", "start"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|