Configure Jira database connectivity via environment variables

Georg Federmann
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!
December 18, 2019

We are running Jira in a docker container and use docker-compose to define the service stack including the RDBMS, we use MySQL in this case.

We would like to override the database connectivity as provided in /var/jira/dbconfig.xml with values specified in docker-compose.yml.

We found sample code on github that seems to demonstrate that overriding database connectivity can be achieved by setting environment variables in the docker-compose file like this:

image: haxqer/jira
container_name: int-jira
- TZ='Europe/Vienna'
- JIRA_DATABASE_URL=jdbc:mysql://localhost:14306/int_jira
- JIRA_DB_USER=int_jira
- int-mysql
- 14080:8080
- ~/jira_data:/var/jira
restart: always
- int_ods_network

When we startup Jira, we find that it still sets up a connectivity to the H2 database as specified in dbconfig.xml.

What would be the correct approach to configure the database in docker-compose, such that the configuration is respected by Jira running in the corresponding container?

0 answers

Suggest an answer

Log in or Sign up to answer