diff --git a/README.md b/README.md index 46407fb..34c8036 100644 --- a/README.md +++ b/README.md @@ -7,9 +7,7 @@ Learn more about how DNMP can streamline your development process and make your ```bash git clone https://github.com/helloxz/dnmp.git cd dnmp -bash dnmp.sh init -# install redis -bash dnmp.sh start redis +bash dnmp.sh run # install phpmyadmin bash dnmp.sh install runtime bash dnmp.sh install phpmyadmin @@ -20,6 +18,5 @@ bash dnmp.sh install phpmyadmin ```bash # reload nginx config docker exec -it nginx xc.sh reload - ``` diff --git a/dnmp.sh b/dnmp.sh index c79df94..087d06b 100644 --- a/dnmp.sh +++ b/dnmp.sh @@ -225,9 +225,33 @@ install(){ } +# 运行服务 +run(){ + # 运行前检查 + run_check + # 创建所需目录,并赋予权限 + mkdir -p mysql/data + mkdir -p mysql/mysql-files + mkdir -p nginx/logs + mkdir -p nginx/ssl + mkdir -p php74/log + chown -R ${USER_ID}:${GROUP_ID} mysql + chown -R ${USER_ID}:${GROUP_ID} nginx + chown -R ${USER_ID}:${GROUP_ID} php74 + # 运行docker-compose + docker-compose up -d + # 运行完成后,提示用户 + echo '------------------------------------------------------' + echo "The dnmp service start success." + echo '------------------------------------------------------' +} + # 通过case判断用户输入的第一个参数,然后执行对应函数的动作 case $1 in + 'run') + run + ;; 'init') init ;;