Hello everyone!
This is a quick tutorial on how to run Xenforo 2 using in containers docker-compose or podman-compose on a Linux host.
I'm using a VM with Alma Linux installed, this means that SELinux is enforced so this guide should work with any Linux VM.
All the dependencies you need are nginx and podman or docker and docker/podman-compose.
Once you have those installed all you need to do is download the code repo from my website and run podman compose up -d after you place the Xenforo code inside the application folder.
It should start the services. You can tweak varios settings in ./config/php.ini or ./config/nginx/conf.d/default.conf. If you have any questions feel free to reach out!
Here's how the docker-compose file looks:
If your services are running all you need to do now is setup the Nginx running on the VM as a reverse proxy, or apache if you use that.
Here's my nginx config:
This is a quick tutorial on how to run Xenforo 2 using in containers docker-compose or podman-compose on a Linux host.
I'm using a VM with Alma Linux installed, this means that SELinux is enforced so this guide should work with any Linux VM.
All the dependencies you need are nginx and podman or docker and docker/podman-compose.
Once you have those installed all you need to do is download the code repo from my website and run podman compose up -d after you place the Xenforo code inside the application folder.
It should start the services. You can tweak varios settings in ./config/php.ini or ./config/nginx/conf.d/default.conf. If you have any questions feel free to reach out!
Here's how the docker-compose file looks:
YAML:
services:
nginx:
build:
context: ./
dockerfile: nginx.dockerfile
ports:
- "8080:80" # change port 10080 to any other port
volumes:
- ./config/nginx/conf.d:/etc/nginx/conf.d:z
- ./data/nginx:/var/log/nginx:z
- application:/var/www/html:z
depends_on:
- php
php:
build:
context: ./
dockerfile: php83.dockerfile
volumes:
- ./config/php.ini:/usr/local/etc/php/php.ini:z
- application:/var/www/html:z
database:
image: "postgres:latest"
ports:
- 15432:5432
environment:
POSTGRES_PASSWORD: denis
POSTGRES_USER: batman
volumes:
- ./data/postgres/:/var/lib/postgresql/data/:z
maria:
image: mariadb
restart: always
ports:
- 13306:3306
environment:
MARIADB_ROOT_PASSWORD: example
volumes:
- ./data/maria/:/var/lib/mysql:z
volumes:
application:
driver: local
driver_opts:
type: none
device: ./application
o: bind
If your services are running all you need to do now is setup the Nginx running on the VM as a reverse proxy, or apache if you use that.
Here's my nginx config:
Code:
server {
listen 80;
server_name yourdomain.com;
client_max_body_size 256M;
location / {
proxy_pass http://localhost:4080; # Forward requests to localhost:4000
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
# Optional: Custom error pages
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}