As I said, this is nothing but a template for you to improve upon; This will put you on the right track to a fully deployed setup - I personally would not be using
bitnami
or
standard
packages and would use
rapidfort
images instead.
It's worth noting that my servers are not exposed to the internet as we have two different firewalls that are only setup to allow access to the ports we've specified, which in this case are 443 and 80, and even then ONLY to Cloudflare's proxy; If you are intending to use this on a server that does not have a local firewall (or even a network firewall from your provider).
You should adjust your settings to prevent port exposure.
Networks are bridged like this so if you do choose to add network rules or a firewall for your server-side based connections, you can effectively isolate the frontend traffic and the backend traffic. This also makes it easier to review your traffic (fe/be) when using something like nettop, bashtop, or nload.
I personally am not a fan of Traefik, NGINX has been stable and very robust for me for years. I have zero intention of changing it.
Additionally, Certbot was only added to this composer file because in my setup, I do not use a certificate manager - rather, Cloudflare provides me with certificates to use that can be validated using their authenticated origin proxy functions.
Redis is used for Page Cache (See Xon's addons, and Xenforo Docs). While it does not use "a lot" of memory or storage, having Redis can decrease the time it takes to generate pages for guests. and also be used to store things like sessions, etc.
Again, Bitnami was only used for ease of the docker compose file - not everyone is experienced with Docker and using images that are minimized can sometimes skip over entire configuration options that can be defined via environment. The goal here was to provide as minimal of a configuration as needed (.env and compose file).
I would recommend using images by
rapidfort
as they have been minimized and bloat has been removed. However they are a copy of the bitnami images (pre-debloat). The downside here is that there is no
php-fpm
image by these guys.
Personally, I compile my own php image as in order to use video functions with XenForo MG, you require ffmpeg; thus my php-fpm image contains ffmpeg for execution of video conversion - Though i'd argue conversions should be piped to a ffmpeg docker image, however that would require modification of the code.
Not everyone uses Elasticsearch. I just didn't include it because I didn't feel like it.
Code:
elasticsearch:
container_name: xenforo_elasticsearch
image: bitnami/elasticsearch:latest
networks:
- backend
ports:
- 9200:9200
- 9300:9300
environment:
- ELASTICSEARCH_HEAP_SIZE=1g
volumes:
- elasticsearch_data:/bitnami/elasticsearch/data
healthcheck:
test: ["CMD-SHELL", "curl -fsSL 'http://localhost:9200/_cat/health?h=status' | grep yellow"]
interval: 1s
timeout: 3s
retries: 5
volumes:
elasticsearch_data:
driver: local
Add the above to include Elastic. Please note that the above example includes no replication and therefore will return a
yellow
status, so the health-check here has been modified to check for "yellow" and mark it as healthy if so.
-----
It is worth noting that my configuration looks nothing like the above, considering my Docker Compose file contains replication of sql, redis, and elastic; I am also using MariaDB for better performance in comparison to MySQL; Let alone use of 1Password Connect for secrets automation, and backup programs that make snapshots of everything a few times a day and backs up to B2.
Like I said, if there is enough "demand" for a more "official" docker file that can be used to bring up an entire configuration of XenForo, I'd happily evaluate publishing images to make it happen. But the big thing here, is that no matter what I do -
I cannot include XenForo in the distribution.
So really, a well formatted Docker Compose Stack with a well formatted "Get Started" guide would likely be the better approach (minus building an fpm image capable of ffmpeg).