this blog is used to introduce the technology that uses Docsify to quickly build a personal knowledge share website.Docsify is a static website gen framework which convert the md file to a static webpage.
Download
We need to download these softwares:
local: node
remote server:docker nginx
docker is a tool to download develop software,like a app store, but docker serves developers.nginx is a lightweight web server.Nginx can be used as a proxy server,load balance server, static webpage server.Nginx is characterized by less RAM and high concurrency.In this blog,I will use nginx to deploy a static website.
# skip the download proccess of docker,only introduce how to use docker # search xx in docker hub docker search xx # download the latest xx image docker pull xx(xx:latest) # create xx container(a image can have any amount of container) docker run --restart=unless-stopped # or other args like always --name=mysql # container name --privileged=true # security policy:allow # Map the file/folder on the host to the file/folder on the container(two way binding).The gengeral mapping content is the log,data,configuration.You must ensure that the files or folders(the files inside are completely consistent) of both exist.How to ensure?you can use the "docker cp" to copy the folder/file in the container to the host,after deleting the container,re-creat a new container to save time.Why mapping?Modify the content of the file is very troublesome.You need to enter the container and download vim(apt-get uodate,apt-get install vim),so that it consumes time and waste space(Maybe 100MB).Finally,you must konw the path of container data/log/configuration,the path of each software is diffrent. -v /mydata/mysql/log:/var/log/mysql #log mapping -v /mydata/mysql/data:/var/lib/mysql # date mapping -v /mydata/mysql/conf:/etc/mysql # configuration mapping -v /etc/localtime:/etc/localtime:ro # others:like time mapping # port mapping -p 3306:3306 # image name -d xx # other shell # show images list docker images # show running container docker ps # show all container docker ps -a # update some running arguments docker update containername/id --aa=bb # stop running container docker stop/kill containername/id # delete container(you must stop it,then you can delete it) docker rm containername/id # delete image docker rmi containername/id # view the log of containername/id docker logs containername/id # enter the container docker exec -it containername/id bash # copy the front(don't add /) to the back(need to add /),you can exchange order docker cp containername/id:containerpath hostpath