1 Star 0 Fork 3

Rooit/fast-api-demo

forked from amspring/fast-api-demo 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
docker.sh 1.03 KB
一键复制 编辑 原始数据 按行查看 历史
#!/bin/bash
# shellcheck disable=SC2154
if [[ $env = "prod" ]] ; then
env="prod"
else
# shellcheck disable=SC1068
env="dev"
fi
echo "cd /opt/app/code"
cd /opt/app/code || exit
if [ ! -f "config.yml" ];then
echo "cp config.$env.yml!"
cp config/config.$env.yml config.yml
echo "cp success! after you show put your setting in config.yml"
else
echo "config.yml file already exists"
fi
echo "install requirements"
python -m pip install --upgrade pip
pip install --no-cache-dir --upgrade -r requirements.txt
echo "install requirement success!"
echo "copy *.ini to /etc/supervisor/conf.d"
cp config/*.ini /etc/supervisor/conf.d/
echo "start service"
tmp_path=/tmp/$(date "+%Y%m%d%H%M%S").txt
supervisorctl reread >> "$tmp_path"
# shellcheck disable=SC2002
if cat "$tmp_path" | grep 'No config updates to processes'> /dev/null
then
echo "No config updates to processes! run restart"
supervisorctl restart all
else
echo "supervisor config is change! update now"
supervisorctl update all
fi
rm "$tmp_path"
echo "Start success!"
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/irooit/fast-api-demo.git
[email protected]:irooit/fast-api-demo.git
irooit
fast-api-demo
fast-api-demo
master

搜索帮助