chore(docker): update docker/php/entrypoint.sh

This commit is contained in:
2025-12-25 09:07:34 +08:00
parent 866ca8d938
commit 2eb98efe61

View File

@@ -3,15 +3,10 @@ set -e
echo "=== ThinkPHP Docker权限初始化 ===" echo "=== ThinkPHP Docker权限初始化 ==="
# 定义应用根目录,支持参数传入 # 定义应用根目录,优先使用环境变量,否则使用默认值
APP_ROOT="${1:-/var/www/html}" APP_ROOT="${PHP_APP_ROOT:-/var/www/html}"
echo "使用应用根目录: $APP_ROOT" echo "使用应用根目录: $APP_ROOT"
if [ $# -eq 1 ]; then
echo "✅ 使用传入参数: $1"
else
echo "✅ 使用默认参数: /var/www/html"
fi
# 获取正确的用户和组 # 获取正确的用户和组
if [ -n "$USER_ID" ] && [ -n "$GROUP_ID" ]; then if [ -n "$USER_ID" ] && [ -n "$GROUP_ID" ]; then