Confluence Docker - When were database config vars and cluster vars added?
Asked by Dan Koester:

Hi -

I am running Confluence 7.0.5 in a container and am trying to use the Database configuration variables(ALT_JDBC_URL, USER, etc) but it is not getting written to the resulting confluence.cfg.xml file on my filesystem. The cluster variables are not working either. Were these variables added after the 7.0 release?

Sorry to tag you, [@Dave Chevell](/t5/user/viewprofilepage/user-id/792201) but I have been using your containers since before they were officially supported so I bet you know the answer :) My docker start command below -

docker run -d --name conf_node2 \\

-v /etc/localtime:/etc/localtime:ro \\

-v /docker/confluence_TEST:/var/atlassian/application-data/confluence \\

-v /confluence_data:/var/atlassian/application-data/confluence/shared-home \\

-e ALT_JDBC_URL="postgresql://x.x.x.x01:5432/confluence" \\

-e ALT_JDBC_USER=xxxx \\

-e ALT_JDBC_PASSWORD=xxxx \\

-e ALT_DB_TYPE=postgresql \\

-e ATL_PROXY_NAME=xxx.xxx.xxx \\

-e ATL_PROXY_PORT=443 \\

-e ATL_TOMCAT_SCHEME=https \\

-e ATL_TOMCAT_SECURE=true \\

-e ATL_DB_POOLMAXSIZE=125 \\

-e ALT_CLUSTER_TYPE=tcp_ip \\

-e ALT_CLUSTER_NAME=BankConfluence \\

-e ALT_CLUSTER_PEERS=172.18.0.5,172.18.0.6 \\

-e JVM_SUPPORT_RECOMMENDED_ARGS="-Djavax.net.ssl.trustStore=/var/atlassian/application-data/confluence/shared-home/cacerts.jks -Dconfluence.cluster.node.name=Conf_Node2" \\

-p 8092:8090 \\

--network jiranodes \\

--restart unless-stopped \\

atlassian/confluence-server:7.0.5

Thanks,

Dan


Answers:
author: Dan Koester
body: So I checked the jinja template file at /opt/atlassian/etc/confluence.cfg.xml.j2 and those properties are there so I guess that answers my question regarding if they are in this version or not.

I am using a bind mount for /var/atlassian/application-data/confluence so I guess I will just go manually change the xml file for now.

comments: author: Dave Chevell
body: Hey [@Dan Koester](/t5/user/viewprofilepage/user-id/1767659) ! I'm flattered you remember my old containers :)

I tested out your docker run example and spotted the issue: your DB environment variables are prefixed with **ALT** instead of **ATL** - that's why they're not working

Switch that up and try it again, let me know if it works for you!

Cheers

Dave


author: Dan Koester
body: well, that is mildly embarrassing lol. That fixed it, works great now.

To confirm, if the confluence.cfg.xml file exists already on the persistence storage, re-creating that container with all the variables defined in the docker start command will not overwrite them correct?


author: Dave Chevell
body: We've all been there - the other day I couldn't get my laptop to wake up, keyboard did nothing, screen did nothing ... until I realised my laptop was still in my bag and the monitor / keyboard weren't actually plugged into anything.

You're right about confliuence.cfg.xml not being overwritten if it already exists - that's the general approach taken to config files in the home directory for our Dockerised apps, since this may be a location you mount persistently and want to be able to apply by-hand changes to.


author: Dan Koester
body: great, thanks for the prompt responses!


Tags: docker

server