1 Star 0 Fork 102

尹瑜/go-things物联网云平台

forked from 联犀/things 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
init.sh 1.00 KB
一键复制 编辑 原始数据 按行查看 历史
杨磊 提交于 2021-07-19 20:15 . 完善脚本
#!/bin/sh
CURDIR="`pwd`"/"`dirname $0`"
#echo $CURDIR
echo "well come to go-things,we need init docker with docker-compose first"
function init_docker(){
echo "init docker"
curl -sSL https://get.daocloud.io/docker | sh
sudo systemctl start docker
docker run hello-world
}
function init_docker_compose(){
echo "init docker_compose"
curl -L https://get.daocloud.io/docker/compose/releases/download/1.12.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
docker-compose version
}
function init_mysql_db_table(){
usersvr=$(cat $CURDIR/db/usersvr.sql)
sudo docker exec -it mysql-docker bash -c "mysql -uroot -ppassword -e '$usersvr'"
}
type docker >/dev/null 2>&1 || init_docker;
type docker-compose >/dev/null 2>&1 || init_docker_compose;
echo "docker with docker-compose init success"
echo "now buid and start go-things needs mirror image"
echo "docker-compose -f $CURDIR/docker-compose.yml up -d" >> /etc/rc.d/rc.local
docker-compose up -d
#init_mysql_db_table
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/Yinyuliao/things.git
git@gitee.com:Yinyuliao/things.git
Yinyuliao
things
go-things物联网云平台
master

搜索帮助