- 以google cloud 的 CentOS7 为例,前提你有VPS和有个域名绑定好IP
date -R
sudo cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
sudo yum -y install yum-utils device-mapper-persistent-data lvm2
sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
sudo vi /etc/yum.repos.d/wandisco-git.repo
- git仓内容如下:
[WndiscoGIT]
name=Wandisco Git Repo
baseurl=http://opensource.wandisco.com/centos/7/git/$basearch/
enabled=1
gpgcheck=0
sudo yum makecache
sudo yum -y install git
sudo yum -y install docker-ce
sudo systemctl enable docker
sudo systemctl start docker
sudo curl -L "https://github.com/docker/compose/releases/download/1.25.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
- 验证是否安装成功,弹出版本信息即表示OK
git --version
sudo docker -v
sudo docker-compose version
git clone https://github.com/0758jian/docker-compose-v2ray.git v2ray
cd v2ray
sudo docker-compose up -d
sudo docker-compose ps
- BBR加速,看自己喜欢选择,我选择的是1、5、10
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
sudo yum -y install wget
sudo wget -N --no-check-certificate "https://raw.githubusercontent.com/chiakge/Linux-NetSpeed/master/tcp.sh"
sudo chmod +x tcp.sh
sudo ./tcp.sh
- 服务器只开通80 443 22(SSH建议改为其他端口登陆)
- 用speedtest官方容器来做个测整站
- caddy和v2ray的配置参数,请修改为不同不要用example的
- 查看容器日志 docker-compose logs caddy
- 重启某个容器 docker-compose restart caddy
- 使用v2ray的h2协议,要进入v2ray容器把证书link过来,注意你的域名
ln -s /data/caddy/certificates/acme-v02.api.letsencrypt.org-directory/yourdomain/yourdomain.crt /etc/v2ray/yourdomain.crt
ln -s /data/caddy/certificates/acme-v02.api.letsencrypt.org-directory/yourdomain/yourdomain.key /etc/v2ray/yourdomain.key
- TG技术群:https://t.me/ousiqi