fix(stack): 开发模式移除VOLUME消除runtime遮蔽,run.sh权限与su写法修复

- docker-dev/docker-dev-sync 删除 4 行 VOLUME:匿名卷会遮蔽整目录 bind mount 的宿主 runtime(已实证:宿主看不到容器日志)
- run.sh 统一四目录 777 + umask + 正确 su 写法(-s /bin/sh,www-data 为 nologin)
- serve/full/author 生产模式 VOLUME 保留作 docker run -v 兜底
This commit is contained in:
augushong
2026-09-09 14:45:21 +00:00
parent 553047025c
commit e5cbb48bcc
7 changed files with 18 additions and 21 deletions

View File

@@ -84,10 +84,8 @@ COPY source/stack/docker-dev-sync/source/docker/zzz-xdebug.ini /usr/local/etc/ph
# Create source mount point (host code staging area)
RUN mkdir -p /var/www/source
VOLUME /var/www/html/runtime
VOLUME /var/www/html/public/storage
VOLUME /var/www/html/public/build
VOLUME /var/www/html/storage
# 同步模式:代码 rsync 到容器本地,runtime 由 run.sh 启动时 chmod 777 重建,
# sync.sh 已排除 runtime;匿名卷在容器重建后并不延续,故不声明 VOLUME
# Expose Nginx port
EXPOSE 8000

View File

@@ -67,8 +67,8 @@ mkdir -p /var/www/html/runtime/nginx && chmod 777 /var/www/html/runtime/nginx
echo "参数为:$@"
if [ "$1" = "server" ] || [ "$1" = "" ]; then
# Run timer (background)
su -www-data -c "nohup php /var/www/html/think timer --local --quiet &"
# Run timer (background, as www-data; nologin account requires -s /bin/sh with username last)
su -s /bin/sh -c "nohup php /var/www/html/think timer --local --quiet &" www-data
# Run nginx
service nginx start
# Run php-fpm (foreground, keeps container alive)