Configure Jira database connectivity via environment variables

Georg Federmann 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:

services:
int-jira:
image: haxqer/jira
container_name: int-jira
environment:
- TZ='Europe/Vienna'
- JIRA_DATABASE_URL=jdbc:mysql://localhost:14306/int_jira
- JIRA_DB_USER=int_jira
- JIRA_DB_PASSWORD=#####
depends_on:
- int-mysql
ports:
- 14080:8080
volumes:
- ~/jira_data:/var/jira
restart: always
networks:
- 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