bash <(wget --no-check-certificate -qO- 'https://raw.githubusercontent.com/MoeClub/Note/master/InstallNET.sh') -d 11 -v 64 -p lion123 -port 22
密码:自己改
端口:自己改
apt update -y && apt upgrade -y && apt install -y curl wget sudo socat
curl -fsSL https://get.docker.com | sh
mkdir -p /home/nginx
touch /home/nginx/nginx.conf
mkdir -p /home/nginx/certs
curl https://get.acme.sh | sh
~/.acme.sh/acme.sh --register-account -m xxxx@gmail.com
~/.acme.sh/acme.sh --issue -d kjlion.gq --standalone
~/.acme.sh/acme.sh --installcert -d kjlion.gq --key-file /home/nginx/certs/key.pem --fullchain-file /home/nginx/certs/cert.pem
cd /home/nginx/certs && nano cert.pem
cd /home/nginx/certs && nano key.pem
cd /home/nginx/ && nano nginx.conf
events {
worker_connections 1024;
}
http {
server {
listen 80;
server_name a.kjlion.gq;
return 301 https://www.baidu.com$request_uri;
}
server {
listen 443 ssl http2;
server_name a.kjlion.gq;
ssl_certificate /etc/nginx/certs/cert.pem;
ssl_certificate_key /etc/nginx/certs/key.pem;
return 301 https://www.baidu.com$request_uri;
}
}
events {
worker_connections 1024;
}
http {
client_max_body_size 1000m;
#上传限制参数1G以内文件可上传
server {
listen 80;
server_name b.kjlion.gq;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2;
server_name b.kjlion.gq;
ssl_certificate /etc/nginx/certs/cert.pem;
ssl_certificate_key /etc/nginx/certs/key.pem;
location / {
proxy_pass http://127.0.0.1:5212;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
}
events {
worker_connections 1024;
}
server {
listen 80;
server_name c.kjlion.gq;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl http2;
server_name c.kjlion.gq;
ssl_certificate /etc/nginx/certs/cert.pem;
ssl_certificate_key /etc/nginx/certs/key.pem;
charset utf-8; # 添加这行来指定编码
location / {
root /usr/share/nginx/html;
index index.html;
}
}
docker run -d --name nginx -p 80:80 -p 443:443 -v /home/nginx/nginx.conf:/etc/nginx/nginx.conf -v /home/nginx/certs:/etc/nginx/certs -v /home/nginx/html:/usr/share/nginx/html nginx:latest
docker ps -a
docker update --restart=always nginx
Docker常用命令
apt update -y && apt upgrade -y && apt install -y curl wget sudo socat
curl -fsSL https://get.docker.com | sh && ln -s /usr/libexec/docker/cli-plugins/docker-compose /usr/local/bin
查看 Docker 版本
docker --version
查看 Docker Compose 版本
docker-compose --version
查看本地镜像列表
docker image ls
下载更新镜像
docker pull nginx
下载更新compose中所有镜像
docker-compose pull
删除compose中所有镜像
docker-compose down --rmi all
docker image rm -f nginx
docker ps -a 查看已经创建的容器
docker ps -s 查看已经启动的容器
docker start con_name 启动容器名为con_name的容器
docker stop con_name 停止容器名为con_name的容器
docker rm con_name 删除容器名为con_name的容器
sudo docker start $(sudo docker ps -a -q)
docker pause $(docker ps -q)
开启:docker update --restart=always 容器名称
关闭:docker update --restart=no 容器名称
docker exec -it 容器名 bash
查看网络
docker network ls
添加网络
docker network create my_network
清理无用镜像,容器,网络,卷,配置等
docker system prune -af --volumes
删除所有容器,镜像,网络
docker rm $(docker ps -a -q) && docker rmi $(docker images -q) && docker network prune
删除docker系统
sudo apt-get remove docker
sudo apt-get remove docker-ce
sudo apt-get purge docker-ce
sudo rm -rf /var/lib/docker
rm /usr/local/bin/docker-compose