Last active
June 2, 2023 02:25
-
-
Save cp-i-pc/bf67555e22873ff04424a13525b2b00e to your computer and use it in GitHub Desktop.
使用 docker 安装各种面板
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -fsSL https://get.docker.com | bash | |
curl -L "https://github.com/docker/compose/releases/download/1.25.3/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose | |
chmod a+x /usr/local/bin/docker-compose | |
# 创建个软链接,以后用 dc 命令来代替 docker-compose | |
rm -rf `which dc` # 若系统中存在 dc 则删除,这个 dc 就是个计算器,完全没有用 | |
ln -s /usr/local/bin/docker-compose /usr/bin/dc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DB_PASS="$(openssl rand -hex 12)" | |
read -p "请输入 sspanel 监听的端口:" HTTP_PORT | |
which docker || (curl -sSL get.docker.com | bash && systemctl enable --now docker) | |
docker run \ | |
--name sspanel_db -d \ | |
-e MYSQL_ROOT_PASSWORD=$DB_PASS \ | |
-v /data/mysql_data:/var/lib/mysql \ | |
mariadb:10.5.1 \ | |
--character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci | |
wget https://github.com/Anankke/SSPanel-Uim/raw/dev/sql/glzjin_all.sql | |
docker exec -i sspanel_db sh -c 'exec mysql -uroot -p"$MYSQL_ROOT_PASSWORD"' <<EOF | |
CREATE DATABASE IF NOT EXISTS sspanel CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; | |
EOF | |
docker exec -i sspanel_db sh -c 'exec mysql -uroot -p"$MYSQL_ROOT_PASSWORD" sspanel' < glzjin_all.sql | |
docker run --name sspanel_uim -d \ | |
--link sspanel_db:db \ | |
-e UIM_ENV_REPLACE_ENABLE=1 \ | |
-e UIM_DB_HOST=db \ | |
-e UIM_DB_DATABASE=sspanel \ | |
-e UIM_DB_USERNAME=root \ | |
-e UIM_DB_PASSWORD=$DB_PASS \ | |
-p ${HTTP_PORT}:80 \ | |
sspaneluim/panel | |
docker exec -i sspanel_uim sh -c 'php xcat Tool initQQWry' | |
docker exec -i sspanel_uim sh -c 'php xcat User createAdmin' | |
docker exec -i sspanel_uim sh -c 'php xcat User resetTraffic' | |
IP=$(curl ip.sb) | |
echo "MySQL root 密码为:$DB_PASS" | |
echo "通过 http://$IP:$HTTP_PORT 访问你的 SSPanel" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
which docker || (curl -sSL get.docker.com | bash && systemctl enable --now docker) | |
mkdir -p sspanel ; cd sspanel | |
git clone https://github.com/Anankke/SSPanel-Uim.git www | |
chmod -R 777 www/storage | |
vim docker-compose.yaml | |
``` | |
version: '3' | |
services: | |
www: | |
image: sspaneluim/panel | |
volumes: | |
- './www:/var/www' | |
ports: | |
- '80:80' | |
restart: always | |
links: | |
- db | |
db: | |
image: mariadb:10.5.1 | |
volumes: | |
- './mysql:/var/lib/mysql' | |
restart: always | |
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci | |
environment: | |
MYSQL_ROOT_PASSWORD: sspanelisbest | |
``` | |
dc up -d | |
sleep 5 | |
dc exec -T db sh -c 'exec mysql -uroot -p"sspanelisbest"' <<EOF | |
CREATE DATABASE IF NOT EXISTS sspanel CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; | |
EOF | |
dc exec -T db sh -c 'exec mysql -uroot -p"$MYSQL_ROOT_PASSWORD" sspanel' < www/sql/glzjin_all.sql | |
dc exec www bash | |
inside www container# run commands here to install composer # https://getcomposer.org/download/ | |
inside www container# php composer.phar install | |
inside www container# cp config/.config.example.php config/.config.php | |
inside www container# cp config/appprofile.example.php config/appprofile.php | |
inside www container# php xcat Tool initQQWry | |
inside www container# php xcat User createAdmin | |
inside www container# php xcat User resetTraffic | |
chmod -R 777 www/storage | |
test@test.com 12345678 | |
# Malio https://github.com/EmiyaTKK/Malio-Theme-for-SSPANEL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git clone https://github.com/v2board/v2board-docker.git | |
cd v2board-docker/ | |
git submodule update --init | |
echo ' branch = dev' >> .gitmodules | |
git submodule update --remote | |
修改 caddy.conf | |
首行 `http://localhost` 换成 `:80` | |
修改 docker-compose.yaml | |
```diff | |
version: '3' | |
services: | |
www: | |
image: tokumeikoi/lcrp | |
volumes: | |
- './www:/www' | |
- './wwwlogs:/wwwlogs' | |
- './caddy.conf:/run/caddy/caddy.conf' | |
- './supervisord.conf:/run/supervisor/supervisord.conf' | |
- './crontabs.conf:/etc/crontabs/root' | |
- './.caddy:/root/.caddy' | |
ports: | |
- '80:80' | |
- '443:443' | |
restart: always | |
+ links: | |
+ - mysql | |
mysql: | |
image: mysql:5.7.29 | |
volumes: | |
- './mysql:/var/lib/mysql' | |
restart: always | |
environment: | |
MYSQL_ROOT_PASSWORD: v2boardisbest | |
MYSQL_DATABASE: v2board | |
``` | |
dc up -d | |
dc exec www bash | |
bash-5.0\# wget https://getcomposer.org/download/latest-stable/composer.phar | |
bash-5.0\# php composer.phar install && php artisan v2board:install | |
__ ______ ____ _ | |
\ \ / /___ \| __ ) ___ __ _ _ __ __| | | |
\ \ / / __) | _ \ / _ \ / _` | '__/ _` | | |
\ V / / __/| |_) | (_) | (_| | | | (_| | | |
\_/ |_____|____/ \___/ \__,_|_| \__,_| | |
请输入数据库地址(默认:localhost) [localhost]: | |
> mysql | |
请输入数据库名: | |
> v2board | |
请输入数据库用户名: | |
> root | |
请输入数据库密码: | |
> v2boardisbest | |
正在导入数据库请稍等... | |
数据库导入完成 | |
请输入管理员邮箱?: | |
> test@test.com | |
请输入管理员密码?: | |
> 12345678 | |
一切就绪 | |
访问 http(s)://你的站点/admin 进入管理面板 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget https://s3.amazonaws.com/releases.whmcs.com/v2/pkgs/whmcs-8.1.3-release.1.zip | |
mkdir -p whmcs-docker/whmcs | |
cd whmcs-docker/whmcs | |
unzip ../../whmcs-8.1.3-release.1.zip | |
touch configuration.php | |
chmod 777 configuration.php | |
cd .. | |
# download license from https://www.htcp.net/3067.html | |
# create docker-compose.yml https://github.com/fauzie/docker-whmcs | |
vim docker-compose.yml | |
``` | |
version: "2" | |
services: | |
mysql: | |
image: mysql/mysql-server:5.7 | |
container_name: "MYSQL" | |
hostname: mysql | |
networks: | |
whmcs: | |
ipv4_address: 172.19.19.2 | |
environment: | |
MYSQL_ROOT_PASSWORD: "<<REPLACE THIS TO YOUR OWN PW>>" | |
MYSQL_ROOT_HOST: '%' | |
MYSQL_DATABASE: 'whmcs' | |
whmcs: | |
image: fauzie/docker-whmcs:latest | |
container_name: "WHMCS" | |
hostname: whmcs | |
networks: | |
whmcs: | |
ipv4_address: 172.19.19.3 | |
depends_on: | |
- mysql | |
environment: | |
WORKER_PROCESSES: 4 | |
PHP_OPCACHE_ENABLE: 1 | |
VIRTUAL_HOST: whmcs.test | |
APP_PASSWORD: <<CHANGE THIS TO YOUR OWN RANDOM APP PW>> | |
WHMCS_SERVER_IP: 172.19.19.1 | |
HTTPS: "off" | |
TZ: "Asia/Hong_Kong" | |
ports: | |
- 80 | |
volumes: | |
- ./whmcs:/var/www/whmcs | |
networks: | |
whmcs: | |
driver: bridge | |
ipam: | |
config: | |
- subnet: 172.19.19.0/29 | |
gateway: 172.19.19.1 | |
``` | |
dc up -d | |
# open http://IP/install/install.php |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment