chore(docker): 使用挂载点,确保目录能够正常被读写

This commit is contained in:
2025-12-02 09:47:34 +08:00
parent fe79d04343
commit 0883c1318b
2 changed files with 21 additions and 6 deletions

15
docker/php/entrypoint.sh Normal file
View File

@@ -0,0 +1,15 @@
#!/bin/bash
# 检查并创建必要的目录
for dir in "/var/www/html/runtime" "/var/www/html/uploads" "/var/www/html/tmp" "/var/www/html/temp"; do
if [ ! -d "$dir" ]; then
mkdir -p "$dir"
echo "创建目录: $dir"
fi
# 设置权限
chmod -R a+rw "$dir"
echo "设置权限: $dir -> a+rw"
done
# 执行原有的启动命令
exec "$@"