用docker安装宝塔

用docker安装宝塔

购买VPS主机:https://www.vultr.com/?ref=8391117-6G

QQ群:397745473

环境准备

购买VPS主机:https://www.vultr.com/?ref=8391117-6G

1
2
3
4
5
6
7
8
9
10
11
apt-get update && apt-get upgrade -y

sed -i 's/#Port 22/Port 9922/g' /etc/ssh/sshd_config && dd if=/dev/zero of=/var/swapfile bs=1M count=2048 && /sbin/mkswap /var/swapfile && /sbin/swapon /var/swapfile && chmod 0600 /var/swapfile && echo "/var/swapfile swap swap defaults 0 0" >>/etc/fstab
sed -i 's/mouse=a/mouse-=a/g' /usr/share/vim/vim81/defaults.vim;

apt install -y docker.io
reboot

apt-get install -y python3-pip
pip3 install docker-compose
service docker start

安装宝塔

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
参考: https://github.com/ifui/baota

git clone https://github.com/ifui/baota.git
cd baota/ && cp .env-example .env
docker-compose up -d app
docker-compose logs app

docker exec -it baota_app_1 bash

# 去掉宝塔强制登陆
sed -i "s|if (bind_user == 'True') {|if (bind_user == 'REMOVED') {|g" /www/server/panel/BTPanel/static/js/index.js

# 还原宝塔强制登陆
sed -i "s|if (bind_user == 'REMOVED') {|if (bind_user == 'True') {|g" /www/server/panel/BTPanel/static/js/index.js

安装选择:
openresty mysql5.6 去掉FTP PHP7.0 PHPmyadmin 编译安装

免费域名

1
https://www.freenom.com/

QQ群:397745473

知识星球