Skip to content

kitbur/docker-flarum

 
 

Repository files navigation

Docker Flarum

logo

This repository provides a stable and working docker-compose setup for Flarum, based on the popular mondedie/flarum configuration, but updated and fixed for a modern Flarum environment.

Tagged Releases

This repository uses a flexible Dockerfile, allowing you to build specific Flarum versions. The following releases are tested configurations.

Features

  • Multi-platform image: linux/amd64, linux/arm64
  • Lightweight & secure image based on Alpine Linux 3.18
  • Nginx and PHP 8.2
  • Configurable Flarum version
  • MariaDB driver
  • OPCache extension configured

Ports

  • The container exposes port 8888 for Flarum. You can map this to any port on your host.

Volumes

  • /flarum/app/public/assets: Flarum assets directory.
  • /flarum/app/storage/logs: Flarum logs directory.
  • /flarum/app/extensions: A control directory for managing extensions.
  • /flarum/app/packages: An optional volume for local extender development.

Environment Variables

Variable Description Type Default value
UID Flarum user id optional 991
GID Flarum group id optional 991
DEBUG Flarum debug mode optional false
FORUM_URL Your forum's public URL required http://localhost:8080
DB_HOST MariaDB instance ip/hostname optional mariadb
DB_USER MariaDB database username optional flarum
DB_NAME MariaDB database name optional flarum
DB_PASS MariaDB database password required some_secure_password
DB_PREF Flarum tables prefix optional none
DB_PORT MariaDB database port optional 3306
FLARUM_PORT Port to run Flarum on inside the container optional 8888
UPLOAD_MAX_SIZE The maximum size of an uploaded file optional 50M
PHP_MEMORY_LIMIT PHP memory limit optional 128M
OPCACHE_MEMORY_LIMIT OPcache memory size in megabytes optional 128
LOG_TO_STDOUT Enable nginx and php error logs to stdout optional false
GITHUB_TOKEN_AUTH Github token to download private extensions optional false
PHP_EXTENSIONS Install additional php extensions (space separated) optional none

Required for First Installation

Variable Description Type Default value
FLARUM_ADMIN_USER Name of your admin user required admin
FLARUM_ADMIN_PASS Admin user password required another_strong_password
FLARUM_ADMIN_MAIL Admin user email address required admin@example.com
FLARUM_TITLE Set the name of your forum optional My Flarum Forum

Installation

1. Clone The Repository

git clone https://github.com/kitbur/docker-flarum.git
cd docker-flarum

2. Create Your Local Configuration

Copy the example compose file to create your own local configuration.

cp docker-compose.yml.example docker-compose.yml

Edit the environment: section to set your own secure passwords, forum title, admin user, public URL, and any other configurations you want.

3. Run It!

Build your Flarum image and start all services.

docker-compose up -d --build

4. Log In

Your forum will be live at the FORUM_URL you configured. Visit the site and log in with your database credentials, as well as the FLARUM_ADMIN_USER and FLARUM_ADMIN_PASS you set in the docker-compose.yml file.


License

This project is released under the MIT License.

About

💬 🐳 Docker image of Flarum 1.8.x and 2.0.0

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages

  • Shell 78.6%
  • Dockerfile 21.4%