You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

102 lines
4.9 KiB

пре 3 година
  1. ### Basic installation
  2. Make sure your environment has Docker installed before installation. The Docker installation tutorial is more online, you can search for it. Here is a highlight of ShowDoc.
  3. ```
  4. # The original official image installation command (Chinese mainland users do not recommend direct use of the original image, you can use the following accelerated image)
  5. Docker pull star7th/showdoc
  6. # Chinese Image Installation Command (Remember to execute the Docker tag command after installation to rename)
  7. Docker pull registry.docker-cn.com/star7th/showdoc
  8. Docker tag registry.docker-cn.com/star7th/showdoc:latest star7th/showdoc:latest
  9. ## Follow-up commands need to be executed whether you use official image or accelerated image
  10. # New directory to store ShowDoc data
  11. Mkdir /showdoc_data
  12. Mkdir /showdoc_data/html
  13. Chmod 777 -R /showdoc_data
  14. # Start the ShowDoc container. Don't forget to follow the steps to transfer data after booting.
  15. docker run -d --name showdoc -p 4999:80 -v /showdoc_data/html:/var/www/html/ star7th/showdoc
  16. # Move data When you execute here, pay attention to the error message that the command line interface has permission to prohibit.
  17. # If there is, check the permissions, or security restrictions (for example, selinux may prohibit the Docker process from writing files)
  18. docker exec showdoc \cp -fr /showdoc_data/html/ /var/www/
  19. # permission
  20. Chmod 777 -R /showdoc_data
  21. ```
  22. According to the above command, the data of ShowDoc will be stored in the /showdoc_data/html directory.
  23. You can access ShowDoc by opening http://localhost:4999 (localhost can be changed to your server domain name or IP). The default admin account is Username: showdoc Password: 123456 . After logging in, you can see the management background entry in the upper right. It is recommended to change the password after login.
  24. For issues or suggestions on ShowDoc, please go to https://github.com/star7th/showdoc to issue an issue. If you think that ShowDoc is easy to use, please star it.
  25. ### How to upgrade
  26. The upgrade here is an upgrade to the above Docker installation. If you used a non-Docker installation (such as PHP installation), please skip this section and go directly to the next section.
  27. ```
  28. / / Stop the container
  29. docker stop showdoc
  30. / / Download the latest code package
  31. Wget https://github.com/star7th/showdoc/archive/master.tar.gz
  32. //Unzip
  33. Tar -zxvf master.tar.gz -C /showdoc_data/
  34. Rm -rf /showdoc_data/html_bak
  35. //Backup. If possible, the html_bak in the command can also be date-suffixed to keep multiple backups of different dates.
  36. Mv /showdoc_data/html /showdoc_data/html_bak
  37. Mv /showdoc_data/showdoc-master /showdoc_data/html ##// */
  38. / / Grant permissions
  39. Chmod 777 -R /showdoc_data/html
  40. / / Start the container
  41. docker start showdoc
  42. // Perform the installation. The Chinese version is installed by default. If you want to install the English version, change the zh in the following parameters to en
  43. Curl http://localhost:4999/install/non_interactive.php?lang=en
  44. / / Transfer the old database
  45. \cp -f /showdoc_data/html_bak/Sqlite/showdoc.db.php /showdoc_data/html/Sqlite/showdoc.db.php
  46. / / Transfer old attachment data
  47. \cp -r -f /showdoc_data/html_bak/Public/Uploads /showdoc_data/html/Public/Uploads
  48. / / Perform a database upgrade, see the word "OK" to prove success
  49. Curl http://localhost:4999?s=/home/update/db
  50. //If there is an error in the middle, please rename the original /showdoc_data/html_bak file to /showdoc_data/html and restart the container to recover.
  51. ```
  52. ### How to upgrade non-Docker installation method to Docker installation method
  53. First refer to the previous article, use Docker way to install a new ShowDoc, and do data persistence.
  54. Next, assuming that the old ShowDoc you originally installed has been uploaded to the /tmp/showdoc directory of the server, then
  55. ```
  56. / / Transfer the old database
  57. \cp -r -f /tmp/showdoc/Sqlite/showdoc.db.php /showdoc_data/html/Sqlite/showdoc.db.php
  58. / / Transfer old attachment data
  59. \cp -r -f /tmp/showdoc/Public/Uploads /showdoc_data/html/Public/Uploads
  60. / / Perform a database upgrade, see the word "OK" to prove success
  61. Curl http://localhost:4999?s=/home/update/db
  62. ```
  63. ### data backup
  64. Just back up the /showdoc_data/html directory. For example, execute the following command to compress and store
  65. ```
  66. Zip -r /showdoc_data/showdoc_bak.zip /showdoc_data/html
  67. //where showdoc_bak.zip can be named with a date suffix for multiple backups. You can also use timed tasks to implement scheduled backups.
  68. ```
  69. ### Other reference commands
  70. ```
  71. docker stop showdoc //stop the container
  72. docker restart showdoc // restart the showdoc container
  73. docker rm showdoc //delete showdoc container
  74. docker rmi star7th/showdoc //delete showdoc image
  75. docker stop $(docker ps -a -q) ;docker rm $(docker ps -a -q) ;//Stop and delete all containers. Dangerous orders, do not know how to use.
  76. ```