| 12345678910111213141516171819202122232425 |
- #!/bin/sh
- set -e
- # 修复 storage 目录权限(挂载卷可能覆盖权限)
- if [ -d /app/storage ]; then
- chmod -R 777 /app/storage 2>/dev/null || true
- chmod -R 777 /app/bootstrap/cache 2>/dev/null || true
- fi
- # 启动 dbus 守护进程(Chrome 需要)
- if [ -x /usr/bin/dbus-daemon ]; then
- mkdir -p /run/dbus
- rm -f /run/dbus/pid
- dbus-daemon --system --fork 2>/dev/null || true
- fi
- # 启动 PHP-FPM(后台运行)
- if [ "$1" = "nginx" ]; then
- echo "Starting PHP-FPM..."
- php-fpm -D
- echo "PHP-FPM started"
- fi
- # 执行传入的命令
- exec "$@"
|