Flarum Docker Management
Hey everyone, this is a tool I've been working on for a little while and thought I'd share. Its function is to assist with testing changes to your forum, without the risk of doing it to your hosted instance.
The way it works is by taking a existing instance of a forum, exporting the database and copying the site files. Then, using docker-compose, it loads up this copy so you can browse and interact with it.
This hasn't been tested when flarum is installed in a subfolder, just as a domain or subdomain.
You will want to copy all files from the root of your flarum install to site/. This can be done with something like rsync
Make sure the database in docker-compose.yml matches what you're using! Some info
# the / after forum/ is important
rsync -a yourserver:/forum/ site/
It's possible to automate this process by overriding the push / pull actions, making the process as easy as
./devsite.sh pull
./devsite.sh start
A couple of niceties:
- No need to configure database credentials
- A self-signed cert is created so that plugins dependent on https work fine (Shout for example)
- SMTP can be disabled, to prevent users from receiving emails accidentally..
You can see more information on setup here
https://github.com/tyler71/flarum-docker-management#flarum-docker-management

The short guide:
- Get a copy of your database and site files
git clone https://github.com/tyler71/flarum-docker-management
cd flarum-docker-management
mkdir site sqlbin
cp example.env .env
sync your site files with site/ and copy your database .sql file to sqlbin/
Run ./devsite.sh start
Open up https://projectname.dev.xyzz.work (resolves to 127.0.0.1)
Run ./devsite.sh enter to run commands like composer update ...
Run ./devsite.sh stop to tear it down.