flarum 不少爱好者论坛使用

仓库 https://github.com/mondediefr/docker-flarum

官网 https://flarum.org 

Features

  • Multi-platform image: linux/386, linux/amd64, linux/arm/v6, linux/arm/v7, linux/arm64
  • Lightweight & secure image
  • Based on Alpine Linux 3.16
  • nginx and PHP 8.0
  • Latest Flarum Framework (v1.3.0)
  • MySQL/Mariadb driver
  • OPCache extension configured

Ports

  • Default: 8888 (configurable)

Environment 

  • VariableDescriptionTypeDefault value
    UIDFlarum user idoptional991
    GIDFlarum group idoptional991
    DEBUGFlarum debug modeoptionalfalse
    FORUM_URLForum URLrequirednone
    DB_HOSTMariaDB instance ip/hostnameoptionalmariadb
    DB_USERMariaDB database usernameoptionalflarum
    DB_NAMEMariaDB database nameoptionalflarum
    DB_PASSMariaDB database passwordrequirednone
    DB_PREFFlarum tables prefixoptionalnone
    DB_PORTMariaDB database portoptional3306
    FLARUM_PORTPort to run Flarum on inside the containeroptional8888
    UPLOAD_MAX_SIZEThe maximum size of an uploaded fileoptional50M
    PHP_MEMORY_LIMITPHP memory limitoptional128M
    OPCACHE_MEMORY_LIMITOPcache memory size in megabytesoptional128
    LOG_TO_STDOUTEnable nginx and php error logs to stdoutoptionalfalse
    GITHUB_TOKEN_AUTHGithub token to download private extensionsoptionalfalse
    PHP_EXTENSIONSInstall additional php extensionsoptionalnone

Required environment variable for first installation

  • VariableDescriptionTypeDefault value
    FLARUM_ADMIN_USERName of your user adminrequirednone
    FLARUM_ADMIN_PASSUser admin passwordrequirednone
    FLARUM_ADMIN_MAILUser admin adress mailrequirednone
    FLARUM_TITLESet a name of your flarumoptionalDocker-Flarum

Docker-compose.yml

version: "3"

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

  mariadb:
    image: mariadb:10.5
    container_name: mariadb
    environment:
      - MYSQL_ROOT_PASSWORD=xxxxxxxxxx
      - MYSQL_DATABASE=flarum
      - MYSQL_USER=flarum
      - MYSQL_PASSWORD=xxxxxxxxxx
    volumes:
      - /mnt/docker/mysql/db:/var/lib/mysql