hijnu commited on
Commit
bb217b1
1 Parent(s): 51fc2d1

Rename entrypoint.sh to run.sh

Browse files
Files changed (2) hide show
  1. entrypoint.sh +0 -24
  2. run.sh +26 -0
entrypoint.sh DELETED
@@ -1,24 +0,0 @@
1
- #!/bin/bash
2
-
3
- app_data_dir="/home/node/.n8n"
4
-
5
- # 检查并创建数据目录
6
- if [ ! -d "$app_data_dir" ]; then
7
- mkdir -p "$app_data_dir"
8
- fi
9
-
10
- # 挂载远程存储到数据目录
11
- # rclone mount remote_name:/path/to/remote/folder $app_data_dir \
12
- # --daemon \
13
- # --allow-other \
14
- # --vfs-cache-mode writes
15
-
16
- # 设置目录权限
17
- chown -R node:node /home/node
18
-
19
- # 启动应用,根据传递的参数决定启动方式
20
- if [ "$#" -gt 0 ];then
21
- exec "$@"
22
- else
23
- exec n8n
24
- fi
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
run.sh ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ # 启动 PostgreSQL 服务
4
+ /usr/local/bin/docker-entrypoint.sh postgres &
5
+
6
+ # 检查 PostgreSQL 服务是否已启动
7
+ echo "等待 PostgreSQL 服务启动..."
8
+ until pg_isready -h localhost; do
9
+ sleep 3
10
+ done
11
+ echo "PostgreSQL 服务已启动!"
12
+
13
+ # 执行数据库导入脚本
14
+ echo "运行数据库导入脚本..."
15
+ /app/import-db.sh
16
+
17
+ sleep 3
18
+
19
+ export N8N_ENCRYPTION_KEY="n8n8n8n"
20
+ # Allows usage of all builtin modules
21
+ export NODE_FUNCTION_ALLOW_BUILTIN=*
22
+ # Allow usage of external npm modules.
23
+ export NODE_FUNCTION_ALLOW_EXTERNAL=*
24
+
25
+ # 使用绝对路径调用 n8n
26
+ exec n8n