Run multiple Openfire servers & DBs in Docker for local testing Federation or Cluster configurations/management
Go to file
Matthew Vivian a64e80e5d2
refactor: rename openfire.sql to clarify execution order
Renamed openfire.sql to 000-init-openfire.sql to make the initialisation order explicit in the filename. This helps when adding additional SQL scripts that need to run after the schema is created, as PostgreSQL executes files in /docker-entrypoint-initdb.d alphabetically.

The new openfire-integration-test repo uses this openfire-docker-compose repository as a base (using git submodules) for its tests but needs to reconfigure Openfire via the database before startup. To do this it overlays additional SQL files into this openfire-docker-compose repository's sql folders so they are run on startup. It has had to prefix its new SQL file with zz- to make sure it runs after the initialisation SQL file in our repository. This change should make future similar uses less complex/error-prone.
2025-01-06 15:47:48 +00:00
_common Add dependency check for docker & compose 2022-07-27 14:47:41 +02:00
cluster refactor: rename openfire.sql to clarify execution order 2025-01-06 15:47:48 +00:00
cluster_with_federation refactor: rename openfire.sql to clarify execution order 2025-01-06 15:47:48 +00:00
federation refactor: rename openfire.sql to clarify execution order 2025-01-06 15:47:48 +00:00
proxy refactor: rename openfire.sql to clarify execution order 2025-01-06 15:47:48 +00:00
scripts Add script to prune _data directories with sudo 2022-07-27 14:47:41 +02:00
simple refactor: rename openfire.sql to clarify execution order 2025-01-06 15:47:48 +00:00
.gitignore Update scripts to ignore fixed name formats 2021-12-20 11:28:33 +00:00
README.md Fix READMEs 2022-07-27 14:47:41 +02:00
stop.sh Drop use of old style "docker-compose" in favour "docker compose" everywhere 2022-07-27 14:47:41 +02:00

README.md

Multiple Openfires in Docker

Quickly create multiple Openfire servers with associated PostgreSQL DBs in Docker containers for local testing.

Data and config snapshots have been taken of each DB and Openfire server so that a known desired state is configured on start. See the "How it's built" section below if you want to understand how this was done or need to add more nodes.

Prerequisites

Quick Start

  1. Make sure you have docker and docker-compose installed
  2. Create a local Openfire docker image, tagged openfire:latest that contains the version of Openfire that you want to run
    1. run docker build --tag openfire:latest . in the root of the Openfire repository (https://github.com/igniterealtime/Openfire)
  3. Launch the environment using the start.sh in the directory of your choice.

How it's built

To recreate the known good state for the system we first create base Openfire and relevant database containers. We then perform the manual setup and any other configuration that we require, such as adding users and MUC rooms. Once the setup is complete we dump the database from the container to the Docker host and copy the Openfire config files from the container to the Docker host. These are then used with Docker volumes for creating the same state in subsequent Openfire and database containers.