zipusyan commited on
Commit
9c1ef9f
·
verified ·
1 Parent(s): 7c22649

Update entrypoint.sh

Browse files
Files changed (1) hide show
  1. entrypoint.sh +5 -6
entrypoint.sh CHANGED
@@ -9,10 +9,9 @@ OP_BACKUP_DIR="/app/defaults/opencode"
9
 
10
  echo "--- Starting Runtime Initialization ---"
11
 
12
- # 1. 修复运行环境
13
- mkdir -p /run/php /var/cache/nginx /var/log/nginx
14
- chmod 755 /run/php
15
- ln -sf /etc/nginx/sites-available/default /etc/nginx/sites-enabled/default
16
 
17
  # 2. 初始化 PHP 网站文件
18
  if [ ! -f "$PHP_WWW_DIR/ftp.php" ]; then
@@ -23,14 +22,14 @@ fi
23
 
24
  # 3. 处理 OpenCode 持久化
25
  mkdir -p "$OP_DATA_DIR"
26
- # 如果持久化目录里没有内容,则还原
27
  if [ ! -d "$OP_DATA_DIR/.opencode" ]; then
28
  cp -r "$OP_BACKUP_DIR/.opencode" "$OP_DATA_DIR/"
29
  fi
30
 
31
- # 创建软链接 (确保程序能找到 /root/.opencode)
32
  rm -rf "$OP_CONFIG_DIR"
33
  ln -s "$OP_DATA_DIR/.opencode" "$OP_CONFIG_DIR"
34
 
35
  echo "--- Initialization Complete. Starting Supervisor ---"
36
  exec /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf
 
 
9
 
10
  echo "--- Starting Runtime Initialization ---"
11
 
12
+ # 1. 修复运行环境 - 必须确保 /var/run/nginx.pid 所在目录存在且可写
13
+ mkdir -p /run/php /var/cache/nginx /var/log/nginx /var/lib/nginx
14
+ chown -R root:root /var/lib/nginx /var/cache/nginx
 
15
 
16
  # 2. 初始化 PHP 网站文件
17
  if [ ! -f "$PHP_WWW_DIR/ftp.php" ]; then
 
22
 
23
  # 3. 处理 OpenCode 持久化
24
  mkdir -p "$OP_DATA_DIR"
 
25
  if [ ! -d "$OP_DATA_DIR/.opencode" ]; then
26
  cp -r "$OP_BACKUP_DIR/.opencode" "$OP_DATA_DIR/"
27
  fi
28
 
29
+ # 创建软链接
30
  rm -rf "$OP_CONFIG_DIR"
31
  ln -s "$OP_DATA_DIR/.opencode" "$OP_CONFIG_DIR"
32
 
33
  echo "--- Initialization Complete. Starting Supervisor ---"
34
  exec /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf
35
+