server.xml is overwritten by Dockerfile

Admin
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 9, 2019

We are running Jira and Confluence as docker containers behind a Nginx reverse proxy. Therefore we need to edit the server.xml to add the proxy configurations. But the Dockerfile is creating a new server.xml out of a template file and this will overwrite the setting we make in this file. Is there any workaround for this?

Sincerely 

2 answers

1 accepted

1 vote
Answer accepted
Bob Swift {Appfire} September 10, 2019

I was able to get our customization working again by copying the template file to the host, modifying it for our purposes, and then copying it back to the template location as part of our startup automation. That copies the file into the running container and restarts:

docker cp ./custom/server.xml.j2 confluence-7.0.1:/opt/atlassian/etc/.
docker restart confluence-7.0.1

BTW, we also use nginx, but the VIRTUAL_... and X_PROXY... variables are sufficient for our purposes so no server.xml customization needed for that. However, we do add data sources to the config.

Admin
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 13, 2019

Thanks, that worked for me. I also tried to set these settings via environment variables at the docker container creation, but this also didn't worked for me.

 

Your solution worked well!

Like 蔡露佳 likes this
0 votes
Russ Calderon November 1, 2019

This worked, i mean all i did was to modify the server.xml.j2 to contain the values that i needed while using nginx, the banner at the bottom at that says something is wrong is gone!

Suggest an answer

Log in or Sign up to answer