- 论坛示例站点:https://bbs.halo.run
1:首先安装docker和docker-compose
不会安装docker的可以查看我博客的安装教程
2:创建项目文件
mkdir -p flarum && cd flarum && touch docker-compose.yaml flarum.env
3:在docker-compose.yaml配置中写入以下配置
services:
flarum:
image: mondedie/flarum:latest
container_name: flarum
env_file:
- ./flarum.env # 站点配置文件
volumes:
- ./flarum/assets:/flarum/app/public/assets
- ./flarum/extensions:/flarum/app/extensions
ports:
- 8888:8888 # 映射端口,不建议修改,不然访问网站可能会报错
restart: always
depends_on:
- mariadb
mariadb:
image: mariadb:10.5
container_name: mariadb
environment:
- MYSQL_ROOT_PASSWORD=abc123456
- MYSQL_DATABASE=flarum
- MYSQL_USER=flarum
- MYSQL_PASSWORD=abc123456
volumes:
- ./mysql:/var/lib/mysql # 数据映射到本地
restart: always
4:在flarum.env配置中写入以下环境配置
DEBUG=false
FORUM_URL=https://example.com # 替换你的论坛域名,提前反代好并开启HTTPS
# 数据库信息,和docker-compose.yaml中保持一致
DB_HOST=mariadb
DB_NAME=flarum
DB_USER=flarum
DB_PASS=abc123456
DB_PREF=flarum_
DB_PORT=3306
# 站点环境变量
FLARUM_ADMIN_USER=admin # 管理员用户名
FLARUM_ADMIN_PASS=admin123456 # 管理员密码
FLARUM_ADMIN_MAIL=admin@admin.com # 管理员邮箱
FLARUM_TITLE=Test flarum # 论坛标题
5:启动
先将端口反代到域名—反代教程
docker compose up -d mariadb # 必须先启动数据库,等待数据库初始化完成
docker compose up -d flarum # 启动站点
启动完成后就可以访问你的域名进入论坛首页了
6:个性化配置
扩展使用示例:
查看所有插件
docker exec -ti flarum extension list
删除插件
docker exec -ti flarum extension remove 作者/插件名
安装插件
docker exec -ti flarum extension require 作者/插件名
安装中文语言插件
docker exec -ti flarum extension require flarum-lang/chinese-simplified:dev-master
安装私信功能插件
docker exec -ti flarum extension require neoncube/flarum-private-messages:"*"
安装HubUi-X主题
docker exec -ti flarum extension require kk14569/flarum-hubui-x
更多插件请查看-官方文档
Comments NOTHING