jamesw853 commited on
Commit
8ca8fb5
·
verified ·
1 Parent(s): e368d06

Create entrypoint.sh

Browse files
Files changed (1) hide show
  1. entrypoint.sh +17 -0
entrypoint.sh ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ set -e
3
+
4
+ # 启动 opencode serve 后台进程
5
+ /home/user/.opencode/bin/opencode serve --host 0.0.0.0 --port 7860 &
6
+ OPCODE_PID=$!
7
+
8
+ # 启动同步脚本(它自身会无限循环)
9
+ python3 /home/user/sync_to_dataset.py &
10
+ SYNC_PID=$!
11
+
12
+ # 等待任意子进程退出(如果 opencode 崩溃,容器也应退出)
13
+ wait -n
14
+
15
+ # 退出时杀死另一个进程
16
+ kill $OPCODE_PID $SYNC_PID 2>/dev/null
17
+ exit $?