refactor: 迁移根目录 docker/ 到 source/docker/,更新所有路径引用

- 将 docker/{nginx.conf,run.sh,zz-phprun.ini,zz-phpfpm.conf} 移动到 source/docker/
- 更新所有 Dockerfile 中 /var/www/html/docker/ -> /var/www/html/source/docker/
- 更新 stack.json managed_files 路径前缀
- 重组 stack 模式目录结构 docker/ -> source/docker/
- 更新 source/README.md 目录描述
- 更新 AdminUpdateServiceBase.php 可选文件前缀
This commit is contained in:
augushong
2026-05-12 23:13:47 +08:00
parent 81706debbb
commit 218810a7db
17 changed files with 28 additions and 29 deletions

View File

@@ -1 +0,0 @@

30
source/docker/nginx.conf Normal file
View File

@@ -0,0 +1,30 @@
server {
listen 8000 default_server;
listen [::]:8000 default_server;
root /var/www/html/public;
index index.php index.html index.htm;
server_name _;
# 上传大小不限制
client_max_body_size 8192m;
# 运行时长不限制
fastcgi_read_timeout 60000;
location / {
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=$1 last; break;
}
}
location ~ \.php$ {
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
}

37
source/docker/run.sh Normal file
View File

@@ -0,0 +1,37 @@
#!/bin/bash
# 将代码中的nginx复制到nginx配置文件中
cp /var/www/html/source/docker/nginx.conf /etc/nginx/sites-available/default
ln -s /etc/nginx/sites-available/default /etc/nginx/sites-enabled/default
# 将代码中的php配置文件复制到php配置文件中
cp /var/www/html/source/docker/zz-phprun.ini /usr/local/etc/php/conf.d
cp /var/www/html/source/docker/zz-phpfpm.conf /usr/local/etc/php-fpm.d
# 设置目录权限,确保挂载卷后依然有效
mkdir -p /var/www/html/runtime && chmod -R 777 /var/www/html/runtime
mkdir -p /var/www/html/public/storage && chmod -R 777 /var/www/html/public/storage
mkdir -p /var/www/html/public/build && chmod -R 777 /var/www/html/public/build
mkdir -p /var/www/html/storage && chmod -R 777 /var/www/html/storage
mkdir -p /var/www/html/memoryspace && chown -R www-data:www-data /var/www/html/memoryspace
# 运行redis
# nohup redis-server --requirepass "" &
# 输出参数
echo "参数为:$@"
# TODO增加自动批量运行并阻塞的脚本比如group default 会调用auto.sh的default的部分最终阻塞auth.sh的default部分可能会运行一系列的命令比如清空缓存踢人下线重置密码
if [ "$1" = "server" ] || [ "$1" = "" ]; then
# 运行定时任务 TODO:以指定用户运行
su - www-data -c "nohup php /var/www/html/think timer --local --quit &"
# 运行nginx
service nginx start
# 运行php-fpm
php-fpm
else
php "/var/www/html/""$@"
fi

View File

@@ -0,0 +1,8 @@
[www]
; 进程数不限制
pm = dynamic
pm.max_children = 150
pm.start_servers = 10
pm.min_spare_servers = 10
pm.max_spare_servers = 30

View File

@@ -0,0 +1,26 @@
; 内存不限制
memory_limit = -1
; 上传文件大小不限制
upload_max_filesize = -1
; 运行时长不限制
max_execution_time = 0
; POST大小不限制
post_max_size = -1
; 设置时区
date.timezone = "Asia/Shanghai"
[Zend Opcache]
opcache.enable = 1
opcache.memory_consumption=128
opcache.interned_strings_buffer=32
opcache.max_accelerated_files=80000
opcache.revalidate_freq=3
opcache.fast_shutdown=1
opcache.enable_cli=1
opcache.jit_buffer_size=128m
opcache.jit=1205