侧边栏壁纸
  • 累计撰写 81 篇文章
  • 累计创建 50 个标签
  • 累计收到 0 条评论

目 录CONTENT

文章目录

搭建一个flarum

shawn
2023-09-05 / 0 评论 / 0 点赞 / 6 阅读 / 2482 字

搭建一个flarum

拉库:

# Pull from hub.docker.com :
docker pull mondedie/flarum:latest

# or build it manually :
docker build -t mondedie/flarum:latest https://github.com/mondediefr/docker-flarum.git

构建一个docker-compose.yml

version: "3"

services:
  flarum:
    image: mondedie/flarum:stable
    container_name: flarum
    env_file:
      - /root/docker/flarum/flarum.env
    volumes:
      - /root/docker/flarum/assets:/flarum/app/public/assets
      - /root/docker/flarum/extensions:/flarum/app/extensions
      - /root/docker/flarum/storage/logs:/flarum/app/storage/logs
      - /root/docker/flarum/nginx:/etc/nginx/flarum
    ports:
      - 11880:8888
    depends_on:
      - mariadb

  mariadb:
    image: mariadb:10.5
    container_name: mariadb
    environment:
      - MYSQL_ROOT_PASSWORD=aaaaaaaaaa..
      - MYSQL_DATABASE=flarum
      - MYSQL_USER=flarum
      - MYSQL_PASSWORD=bbbbbbbbbbb..
    volumes:
      - /root/docker/mysql/db:/var/lib/mysql

塞入env内容

# vi /mnt/docker/flarum/flarum.env

DEBUG=false
FORUM_URL=http://domain.tld

# Database configuration
DB_HOST=mariadb
DB_NAME=flarum
DB_USER=flarum
DB_PASS=xxxxxxxxxx
DB_PREF=flarum_
DB_PORT=3306

# User admin flarum (environment variable for first installation)
# /!\ admin password must contain at least 8 characters /!\
FLARUM_ADMIN_USER=admin
FLARUM_ADMIN_PASS=xxxxxxxxxx
FLARUM_ADMIN_MAIL=admin@domain.tld
FLARUM_TITLE=Test flarum

跑起来

# 跑数据库
docker-compose up -d mariadb
# 跑论坛应用
docker-compose up -d flarum

语言包安装:

docker exec -it flarum sh
cd /flarum/app
# 安装
composer require flarum-lang/chinese-simplified
# 清缓存
php flarum cache:clear
0

评论区