Discuz - 安装 - 优化
Discuz - 安装 - 优化
1 - Install Docker & Mysql 5.7
创建Mysql数据库 {PWD}
修改成实际密码
CREATE DATABASE discuz;
GRANT ALL PRIVILEGES ON discuz.* TO 'discuz'@'%' IDENTIFIED BY '{PWD}';
FLUSH PRIVILEGES;
2 - Pull the Discuz Docker Image
Discuz! X3.5 Release 20230726 UTF-8
注意设置Docker Sock5代理 需要访问 hub.docker.com 国内很多镜像网站下载失败,腾讯云服务器可直接获取
docker pull tencentci/discuz:latest
3 - 创建本地磁盘目录
mkdir -p /mnt/discuz/www
4 - 创建文件 docker-compose.yaml
version: '3'
services:
web:
image: tencentci/discuz:latest
container_name: discuz
ports:
- "28080:80"
volumes:
- discuz-www:/var/www/html
restart: always
volumes:
discuz-www:
driver: local
driver_opts:
type: none
o: bind
device: /mnt/discuz/www
通过命令 检查Docker Volumn
docker volume inspect discuz_discuz-www
5 - docker compose 启动 & 停止
Docker Compose (V1)
docker-compose up -d
docker-compose down
Docker Compose (V2)
docker compose up -d
docker compose down
6 - 清理安装文件
rm -rf www/install/index.php
rm -rf www/uc_server/install/index.php
7 - 修改数据库配置
最后修改于 2024-07-23
此篇文章的评论功能已经停用。