powered by Jive Software

Running Openfire on docker best practices?


#1

Hi!

I’m trying to run openfire (4.2.3) on a docker environment. It works great, but if I try to restart the container, it will forget that it was initialized and ask for the initial setup.
I’ve setup the docker(compose) environment so there are two persistent volumes mounted in the container:

  - of-data:/var/lib/openfire
  - of-conf:/etc/openfire

So, /var/lib/openfire and /etc/openfire are persisted after restarting/recreating the container. However, there’s something I’m missing for sure, because even though if most of the config is there it will ask me to reset the properties key, setup the database connection, etc. (the initial wizard). If I skip creating the admin account, it will use the one already in the database, and after I login, everything is there: users, rooms, plugins, etc.

What could it be that I’m not persisting that keeps triggering Openfire to believe that it’s not installed?

Thanks!


Initial setup marked as "success" even though main property file was not saved
#2

you’ll need to persist everything in (assuming a standard install)

/opt/openfire/conf
/opt/openfire/resources/security

And yes, Openfire doesn’t comply with the standard FHS (https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard)

Greg


#3

PS. I should add -

/opt/openfire/embedded-db contains the database if you’re using the embedded one - in which case you’ll want to persist that, too.
/opt/openfire/logs contains log files; you may want to persist those.

Greg


#4

Thanks! I fixed it. I was already persisting all those files. The problem was that (due to perms), openfire was not able to save the initial openfire.xml. I set the permissions of that directory to rwx for the openfire user and now I can safely recreate the container and everything works :smiley:

The hint was that in the logs, it was complaining about not being able to access openfire.xml.tmp in the same directory where openfire.xml is. The weird thing is that even if there was an exception, installation was marked as “success” (which in my book it should not be a success)