Docker build Showdoc

 

Base installation

Before installation make sure your environment has been installed docker 

 

docker pull star7th/showdoc

 

#新建存放showdoc数据的目录

mkdir /opt/showdoc

mkdir /showdoc/html

chmod -R 777 /showdoc

 

#启动showdoc容器

docker run -d --name showdoc -p 4999:80 -v /showdoc/html:/var/www/html/ star7th/showdoc

According to the above operation command, then, the subsequent data will showdoc stored in / showdoc / html directory.
You can open  http: // localhost: 4999  to access showdoc (localhost can be changed to your server domain name or IP). Account password is showdoc / 123456, after logging in you can see the top right of the entrance management background. It recommended to change the password after login.

 

How to Upgrade

Upgrade here is the upgrade for the installation of the above docker. If you originally non docker mounting (e.g., mounting php), then skip this part of the text, go directly to the lower portion.

  1. //停止容器
  2. docker stop showdoc
  3. //下载最新代码包
  4. wget https://github.com/star7th/showdoc/archive/master.tar.gz
  5. //解压
  6. tar -zxvf master.tar.gz -C /showdoc_data/
  7. rm -rf /showdoc_data/html_bak
  8. //备份。如果可以的话,命令中的html_bak还可以加上日期后缀,以便保留不同日期的多个备份
  9. mv /showdoc/html /showdoc/html_bak
  10. mv /showdoc_data/showdoc-master /showdoc_data/html ##// */
  11. //赋予权限
  12. chmod -R 777 /showdoc_data/html
  13. //启动容器
  14. docker start showdoc
  15. //执行安装。默认安装中文版。如果想安装英文版,将下面参数中的zh改为en
  16. curl http://localhost:4999/install/non_interactive.php?lang=zh
  17. //转移旧数据库
  18. \cp -f /showdoc_data/html_bak/Sqlite/showdoc.db.php /showdoc_data/html/Sqlite/showdoc.db.php
  19. //转移旧附件数据
  20. \cp -r -f /showdoc_data/html_bak/Public/Uploads /showdoc_data/html/Public/Uploads
  21. // 执行数据库升级,看到OK字样便证明成功
  22. curl http://localhost:4999?s=/home/update/db
  23. //如果中途出错,请重命名原来的/showdoc_data/html_bak文件为/showdoc_data/html ,然后重启容器便可恢复。

 

data backup

Backup / showdoc_data / html directory. For example, execute the following command to compact storage

  1. zip -r /showdoc_data/showdoc_bak.zip /showdoc_data/html
  2. //其中showdoc_bak.zip可以用日期后缀命名,以便多个备份。你也可以用定时任务来实现定时备份。

Other commands

  1. docker stop showdoc //停止容器
  2. docker restart showdoc //重启showdoc容器
  3. docker rm showdoc //删除showdoc容器
  4. docker rmi star7th/showdoc //删除showdoc镜像
  5. docker stop $(docker ps -a -q) ;docker rm $(docker ps -a -q) ;//停止并删除所有容器。危险命令,不懂勿用。

 

Has been content from showdoc official: https: //www.showdoc.cc/help page_id = 65610?

Installation Directory adjusted according to individual circumstances.

Guess you like

Origin www.cnblogs.com/panchanggui/p/12042177.html
Recommended