I was able to get it working by adding 172.17.0.1 as the host gateway and also using that as the IP address in the DB connection settings.
Docker-compose:
extra_hosts:
- host.docker.internal:172.17.0.1
Ignition DB connection:
jdbc:mariadb://172.17.0.1:3306/'my-database'
My next port of call was trying to get my configuration to be persistent and you have resolved that for me as well by noticing my volume config was wrong. Thanks for the help