orztv commited on
Commit
dae6979
·
1 Parent(s): 5d0dbfe
Files changed (4) hide show
  1. services.json +7 -12
  2. start.sh +1 -7
  3. traefik/dynamic.yml +1 -30
  4. traefik/traefik.yml +3 -7
services.json CHANGED
@@ -1,15 +1,4 @@
1
  [
2
- {
3
- "name": "python-service",
4
- "command": "python -m http.server $PORT",
5
- "port": 8000,
6
- "path_prefix": "/python",
7
- "health_check_path": "/",
8
- "env": {
9
- "PYTHONUNBUFFERED": "1"
10
- },
11
- "working_dir": "/home/pn/app/python"
12
- },
13
  {
14
  "name": "node-service",
15
  "command": "npx serve -l $PORT",
@@ -28,8 +17,14 @@
28
  "path_prefix": "/",
29
  "health_check_path": "/healthz",
30
  "env": {
 
31
  "N8N_PORT": "5678",
32
- "N8N_EDITOR_BASE_URL": "/"
 
 
 
 
 
33
  },
34
  "working_dir": "/home/pn/app/n8n"
35
  }
 
1
  [
 
 
 
 
 
 
 
 
 
 
 
2
  {
3
  "name": "node-service",
4
  "command": "npx serve -l $PORT",
 
17
  "path_prefix": "/",
18
  "health_check_path": "/healthz",
19
  "env": {
20
+ "N8N_EDITOR_BASE_URL": "/",
21
  "N8N_PORT": "5678",
22
+ "N8N_HOST": "0.0.0.0",
23
+ "WEBHOOK_URL": "https://hijnu-traefik.hf.space/",
24
+ "GENERIC_TIMEZONE": "Asia/Shanghai",
25
+ "N8N_METRICS": "true",
26
+ "QUEUE_HEALTH_CHECK_ACTIVE": "true",
27
+ "N8N_PAYLOAD_SIZE_MAX": "256"
28
  },
29
  "working_dir": "/home/pn/app/n8n"
30
  }
start.sh CHANGED
@@ -12,12 +12,6 @@ trap "log '收到终止信号,关闭进程...'; kill \$(jobs -p) 2>/dev/null;
12
  # 读取服务配置
13
  services=$(jq -c '.[]' services.json)
14
 
15
- # 创建测试文件并写入内容
16
- touch /home/pn/app/python/hi.txt
17
- echo "Hello, Python!" > /home/pn/app/python/hi.txt
18
- touch /home/pn/app/node/hi.txt
19
- echo "Hello, Node!" > /home/pn/app/node/hi.txt
20
-
21
  # 启动服务
22
  echo "$services" | while read -r service; do
23
  name=$(echo $service | jq -r '.name')
@@ -75,4 +69,4 @@ echo "$services" | while read -r service; do
75
  done
76
 
77
  # 启动 Traefik
78
- exec traefik --configFile=$TRAEFIK_CONFIG_FILE
 
12
  # 读取服务配置
13
  services=$(jq -c '.[]' services.json)
14
 
 
 
 
 
 
 
15
  # 启动服务
16
  echo "$services" | while read -r service; do
17
  name=$(echo $service | jq -r '.name')
 
69
  done
70
 
71
  # 启动 Traefik
72
+ exec traefik --configFile=$TRAEFIK_CONFIG_FILE
traefik/dynamic.yml CHANGED
@@ -1,24 +1,10 @@
1
  http:
2
  routers:
3
  root:
4
- rule: "PathPrefix(`/`) && !PathPrefix(`/python`) && !PathPrefix(`/node`) && !PathPrefix(`/traefik`)"
5
  service: n8n-service
6
  priority: 1
7
 
8
- traefik-dashboard:
9
- rule: "PathPrefix(`/traefik`)"
10
- service: api@internal
11
- priority: 2
12
- middlewares:
13
- - traefik-dashboard-stripprefix
14
-
15
- python-service:
16
- rule: "PathPrefix(`/python`)"
17
- service: python-service
18
- priority: 2
19
- middlewares:
20
- - python-service-stripprefix
21
-
22
  node-service:
23
  rule: "PathPrefix(`/node`)"
24
  service: node-service
@@ -27,16 +13,6 @@ http:
27
  - node-service-stripprefix
28
 
29
  middlewares:
30
- traefik-dashboard-stripprefix:
31
- stripPrefix:
32
- prefixes:
33
- - "/traefik"
34
-
35
- python-service-stripprefix:
36
- stripPrefix:
37
- prefixes:
38
- - "/python"
39
-
40
  node-service-stripprefix:
41
  stripPrefix:
42
  prefixes:
@@ -48,11 +24,6 @@ http:
48
  servers:
49
  - url: "http://localhost:5678"
50
 
51
- python-service:
52
- loadBalancer:
53
- servers:
54
- - url: "http://localhost:8000"
55
-
56
  node-service:
57
  loadBalancer:
58
  servers:
 
1
  http:
2
  routers:
3
  root:
4
+ rule: "PathPrefix(`/`) && !PathPrefix(`/python`) && !PathPrefix(`/node`) && !PathPrefix(`/traefik`) && !PathPrefix(`/dashboard`)"
5
  service: n8n-service
6
  priority: 1
7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  node-service:
9
  rule: "PathPrefix(`/node`)"
10
  service: node-service
 
13
  - node-service-stripprefix
14
 
15
  middlewares:
 
 
 
 
 
 
 
 
 
 
16
  node-service-stripprefix:
17
  stripPrefix:
18
  prefixes:
 
24
  servers:
25
  - url: "http://localhost:5678"
26
 
 
 
 
 
 
27
  node-service:
28
  loadBalancer:
29
  servers:
traefik/traefik.yml CHANGED
@@ -3,7 +3,7 @@ global:
3
  sendAnonymousUsage: false
4
 
5
  log:
6
- level: DEBUG
7
 
8
  entryPoints:
9
  web:
@@ -16,18 +16,14 @@ providers:
16
 
17
  api:
18
  insecure: true
19
- dashboard: true
20
 
21
  serversTransport:
22
- maxIdleConnsPerHost: 100
23
 
24
  pilot:
25
  dashboard: false
26
 
27
- experimental:
28
- plugins:
29
- enabled: false
30
-
31
  # 设置 Traefik 以 pn 用户权限运行
32
  users:
33
  - name: pn
 
3
  sendAnonymousUsage: false
4
 
5
  log:
6
+ level: INFO
7
 
8
  entryPoints:
9
  web:
 
16
 
17
  api:
18
  insecure: true
19
+ dashboard: false
20
 
21
  serversTransport:
22
+ maxIdleConnsPerHost: 1000
23
 
24
  pilot:
25
  dashboard: false
26
 
 
 
 
 
27
  # 设置 Traefik 以 pn 用户权限运行
28
  users:
29
  - name: pn