showdoc简单部署

showdoc简单部署_第1张图片

官网地址

码云分享

gitlab地址

ShowDoc简介

ShowDoc是什么

每当接手一个他人开发好的模块或者项目,看着那些没有写注释的代码,我们都无比难受。如果有相关的文档不仅仅可以提高效率,也可以减少方向性的错误。Show me the doc !!

程序员都很希望别人能写技术文档,而自己却很不希望要写文档。因为写文档需要花大量的时间去处理格式排版,想着新建的word文档放在哪个目录等各种非技术细节。

word文档零零散散地放在团队不同人那里,需要文档的人基本很难有整个系统的文档,艰难获取文档文档本身也是效率不高的一种体现。

ShowDoc就是一个非常适合IT团队的在线文档分享工具,它可以加快团队之间沟通的效率。

安装docker

docker安装文献参考

#安装所需的软件包。yum-utils 提供了 yum-config-manager ,并且 device mapper 存储驱动程序需要
 device-mapper-persistent-data 和 lvm2。
 
[root@uias-pro-1-logcatch ~]# yum install -y yum-utils  device-mapper-persistent-data  lvm2

#设置稳定docker仓库,国外比较慢,这里选用清华大学仓库源
[root@uias-pro-1-logcatch ~]# yum-config-manager --add-repo 
 https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/centos/docker-ce.repo

#列出并排序您存储库中可用的版本。此示例按版本号(从高到低)对结果进行排序。
[root@uias-pro-1-logcatch ~]# yum list docker-ce --showduplicates | sort -r
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Loading mirror speeds from cached hostfile
Loaded plugins: fastestmirror, langpacks
docker-ce.x86_64            3:19.03.9-3.el7                     docker-ce-stable
docker-ce.x86_64            3:19.03.8-3.el7                     docker-ce-stable
docker-ce.x86_64            3:19.03.7-3.el7                     docker-ce-stable
docker-ce.x86_64            3:19.03.6-3.el7                     docker-ce-stable
······

#默认安装最新版本
[root@uias-pro-1-logcatch ~]# yum install docker-ce docker-ce-cli containerd.io

[root@uias-pro-1-logcatch ~]# docker -v
Docker version 19.03.12, build 48a66213fe

#测试镜像下载
[root@uias-pro-1-logcatch ~]#  docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
0e03bdcc26d7: Pull complete 
Digest: sha256:d58e752213a51785838f9eed2b7a498ffa1cb3aa7f946dda11af39286c3db9a9
Status: Downloaded newer image for hello-world:latest

Hello from Docker!  
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (amd64)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
 https://hub.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/get-started/

[root@uias-pro-1-logcatch ~]# docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
hello-world         latest              bf756fb1ae65        6 months ago        13.3kB

docker镜像加速

[root@uias-pro-1-logcatch ~]# mkdir -p /etc/docker
[root@uias-pro-1-logcatch ~]# sudo tee /etc/docker/daemon.json <<-'EOF'
> {
>  "registry-mirrors": ["https://jcmwo9z2.mirror.aliyuncs.com"]
> }
> EOF #需要手动输入
{
 "registry-mirrors": ["https://jcmwo9z2.mirror.aliyuncs.com"]
}

[root@uias-pro-1-logcatch ~]#  systemctl daemon-reload
[root@uias-pro-1-logcatch ~]#  systemctl restart docker


https://jcmwo9z2.mirror.aliyuncs.com#加速器地址
这个加速地址谁都可以用,Ubuntu 和 Centos 配置过程相同。
检查加速器是否生效配置加速器之后,如果拉取镜像仍然十分缓慢,请手动检查加速器配置是否生效,
在命令行执行 docker info,如果从结果中看到了如下内容,说明配置成功。

[root@uias-pro-1-logcatch ~]# docker info |grep   https
 Registry Mirrors:
  https://jcmwo9z2.mirror.aliyuncs.com/      #表示配置成功

showdoc基础安装

安装前请确保你的环境已经装好了docker 。

#镜像安装命令
[root@uias-pro-1-logcatch ~]# docker pull registry.cn-shenzhen.aliyuncs.com/star7th/showdoc
Using default tag: latest
latest: Pulling from star7th/showdoc
ff3a5c916c92: Pull complete 
2ca736d3a2d3: Pull complete 
ed01bffbd8ba: Pull complete 
86a241b7142f: Pull complete 
2ffa2200859b: Pull complete 
bba89656402e: Pull complete 
3f9869615113: Pull complete 
ca6f4c22bb7e: Pull complete 
c6e670a03139: Pull complete 
d68194d4a919: Pull complete 
3886fecfffe3: Pull complete 
72d73c916ca2: Pull complete 
66c290981af1: Pull complete 
ae984e1cd476: Pull complete 
4f5c98e97881: Pull complete 
7a5c8005874f: Pull complete 
d0e5afcf9ed6: Pull complete 
a77fddbcccce: Pull complete 
29fbff2beeff: Pull complete 
6acbe516593c: Pull complete 
b2e0f8f06f86: Pull complete 
a3982ad6ae6d: Pull complete 
53fe85e64f8b: Pull complete 
401d987fb2cd: Pull complete 
955b2c3c2280: Pull complete 
b7957d06df75: Pull complete 
fce749939a8f: Pull complete 
747e227b8897: Pull complete 
8eea7612ac50: Pull complete 
fc16400d9d1c: Pull complete 
3e2de92471f0: Pull complete 
d0fab1b01ab7: Pull complete 
cdc70c8f138f: Pull complete 
8af1d51131c5: Pull complete 
163a073524c1: Pull complete 
4b276b9c8786: Pull complete 
0f53e22a4736: Pull complete 
68c6972f770f: Pull complete 
Digest: sha256:c57af4613c277ee56a119983d85e2933aaa7e756aad42c7c1920c6a18aecb144
Status: Downloaded newer image for registry.cn-shenzhen.aliyuncs.com/star7th/showdoc:latest
registry.cn-shenzhen.aliyuncs.com/star7th/showdoc:latest

[root@uias-pro-1-logcatch ~]# docker tag registry.cn-shenzhen.aliyuncs.com/star7th/showdoc:latest star7th/showdoc:latest 

[root@uias-pro-1-logcatch ~]# docker images
REPOSITORY                                          TAG                 IMAGE ID            CREATED             SIZE
registry.cn-shenzhen.aliyuncs.com/star7th/showdoc   latest              c9d88047383f        17 hours ago        393MB
star7th/showdoc                                     latest              c9d88047383f        17 hours ago        393MB
hello-world                                         latest              bf756fb1ae65        6 months ago        13.3kB

新建数据目录

#新建存放showdoc数据的目录

[root@uias-pro-1-logcatch ~]# mkdir -p /data/showdoc_data/html/

[root@uias-pro-1-logcatch ~]# chmod  -R 777 /data/showdoc_data 

#启动容器

[root@uias-pro-1-logcatch ~]# docker run -d --name showdoc --user=root --privileged=true -p 9527:80  -v /data/showdoc_data/html:/var/www/html/ star7th/showdoc
c17deaa2c9aefaaa8803abff64b6eb5f13b4211bdf61f823b335a2c0cbd31414

根据以上命令操作的话,往后showdoc的数据都会存放在 /data/showdoc_data/html 目录下。
可以访问 http://localhost:9527 来访问showdoc (localhost可改为你的服务器域名或者IP)。默认账户密码是showdoc/123456,登录后台管理。

[root@uias-pro-1-logcatch ~]# hostname -I
10.252.71.78 192.168.122.1 172.17.0.1 

web页面访问

showdoc简单部署_第2张图片
showdoc简单部署_第3张图片

showdoc简单部署_第4张图片
showdoc简单部署_第5张图片
showdoc简单部署_第6张图片

新建项目

showdoc简单部署_第7张图片
showdoc简单部署_第8张图片
showdoc简单部署_第9张图片
showdoc简单部署_第10张图片

默认是markdown格式的编辑页面

showdoc简单部署_第11张图片

编辑文档内容

showdoc简单部署_第12张图片
编辑好对应的标题之后保存退出

查看文档内容
showdoc简单部署_第13张图片

基本部署完成,后面可以对文档的私密性,成员管理,高级设置,开放API都可以自由定义,对于可以访问该服务器的用户能够单方面访问分享链接

showdoc简单部署_第14张图片

你可能感兴趣的:(showdoc)