51工具盒子

依楼听风雨
笑看云卷云舒,淡观潮起潮落

Linux环境ShowDoc接口文档安装脚本

此脚本是Linux一键部署ShowDoc接口文档自动化脚本,有需要朋友可以参考,脚本内容如下:

环境准备:

操作系统:CentOS Linux release 7.8.2003文章源自小柒网-https://www.yangxingzhen.cn/7612.html

软件版本:

Docker:docker-ce-19.03.12文章源自小柒网-https://www.yangxingzhen.cn/7612.html

[root@localhost ~]# vim install_showdoc.sh文章源自小柒网-https://www.yangxingzhen.cn/7612.html

#!/bin/bash
#Date:2020-8-21 10:26:28
#Author Blog:
#	https://www.yangxingzhen.cn
#	https://www.i7ti.cn
#Author WeChat:
#	微信公众号:小柒博客
#Author mirrors site:
#	https://mirrors.yangxingzhen.com
#About the Author
#	BY:YangXingZhen
#	Mail:xingzhen.yang@yangxingzhen.com
#	QQ:675583110
#Auto Install Docker-ce And ShowDoc

IPADDR=$(hostname -I \|awk '{print $1}')


安装Docker-ce
===========



rpm -qa \|grep "docker-ce" \>/dev/null 2\>\&1
if \[ $? -ne 0 \];then
#curl -fsSL https://get.docker.com \| bash -s docker --mirror Aliyun
yum -y install yum-utils device-mapper-persistent-data lvm2 \>/dev/null
yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum -y install docker-ce-19.03.12 docker-ce-cli-19.03.12 containerd.io \>/dev/null
fi


配置镜像加速器
=======



mkdir -p /etc/docker
cat \>/etc/docker/daemon.json \<\<EOF
{
"registry-mirrors": \[
"https://hub-mirror.c.163.com",
"https://reg-mirror.qiniu.com",
"https://registry.docker-cn.com",
"https://lhbk6z9b.mirror.aliyuncs.com"
	\]
}
EOF


开启TCP管理端口
=========



sed -i 's#/usr/bin/dockerd#\& -H tcp://0.0.0.0:2375#' /usr/lib/systemd/system/docker.service


启动Docker
========



systemctl daemon-reload
systemctl enable docker
systemctl start docker


安装ShowDoc
=========



拉取ShowDoc镜像(原版官方镜像安装命令)
=======================



#docker pull star7th/showdoc


拉取ShowDoc镜像(基于国内阿里云镜像,安装后记得执行docker tag命令以进行重命名)
================================================



docker pull registry.cn-shenzhen.aliyuncs.com/star7th/showdoc
docker tag registry.cn-shenzhen.aliyuncs.com/star7th/showdoc:latest star7th/showdoc:latest


创建持久化数据目录
=========



mkdir -p /data/showdoc/html


启动ShowDoc
=========



docker run -d --user=root --privileged=true -p 80:80 --name showdoc -v /data/showdoc/html:/var/www/html star7th/showdoc


User="showdoc"
Passwd="123456"


echo -e "\\033\[32mShowDoc访问地址:http://${IPADDR}\\n用户名:${User}\\n密码:${Passwd}\\033\[0m"


脚本执行方式:文章源自小柒网-https://www.yangxingzhen.cn/7612.html

[root@localhost ~]# sh install_showdoc.sh文章源自小柒网-https://www.yangxingzhen.cn/7612.html

脚本执行过程截图如下文章源自小柒网-https://www.yangxingzhen.cn/7612.html

文章源自小柒网-https://www.yangxingzhen.cn/7612.html

文章源自小柒网-https://www.yangxingzhen.cn/7612.html

文章源自小柒网-https://www.yangxingzhen.cn/7612.html 文章源自小柒网-https://www.yangxingzhen.cn/7612.html
继续阅读 Shell最后更新:2022-12-6

赞(0)
未经允许不得转载:工具盒子 » Linux环境ShowDoc接口文档安装脚本