新增docker用法和说明;

This commit is contained in:
2024-04-07 22:45:58 +08:00
parent c0b5880ae1
commit fc07f22253
4 changed files with 104 additions and 24 deletions

View File

@@ -1,21 +1,25 @@
# 将代码中的nginx复制到nginx配置文件中
cp /var/www/html/docker/nginx.conf /etc/nginx/sites-available/default
ln -s /etc/nginx/sites-available/default /etc/nginx/sites-enabled/default
#!/bin/bash
# 将代码中的php配置文件复制到php配置文件中
cp /var/www/html/docker/phprun.ini /usr/local/etc/php/conf.d
# # 将代码中的nginx复制到nginx配置文件中
# cp /var/www/html/docker/nginx.conf /etc/nginx/sites-available/default
# ln -s /etc/nginx/sites-available/default /etc/nginx/sites-enabled/default
# 运行redis
nohup redis-server --requirepass "" &
# 运行定时任务
nohup php /var/www/html/think timer --local &
# # 将代码中的php配置文件复制到php配置文件中
# cp /var/www/html/docker/phprun.ini /usr/local/etc/php/conf.d
# # 运行redis
# nohup redis-server --requirepass "" &
# # 运行定时任务
# nohup php /var/www/html/think timer --local &
# 输出参数
echo "参数为:$@"
# 如果第一个参数是server或者没有参数则运行server
if [ "$1" = "server" ] || [ "$1" = "" ]; then
# 运行nginx
service nginx start
# 运行php-fpm
php-fpm
else
php "/var/www/html/""$@"
php "/var/www/html/""$@"
fi