2 Replies Latest reply on Feb 2, 2016 2:05 PM by Michael Davis

    Configuring a datasource in Wildfly using environment variables for Docker

    Michael Davis Newbie



      I'm preparing to get our Wildfly applications running on Docker. I'm stuck on one thing though.


      I've got a mysql datasource configued in a customized version of standalone.xml. I'm trying to figure out how to reconfigure it to take the parameters:


      database server

      database name

      database username

      database password


      from environment variables. It would be lovely If I could write, in standalone.xml, something like:




      Now, a certain Marek Goldman has published some solutions to this here:




      The one that seems best is configuring the datasource using a cli script after wildfly is running, but that seems like a kludge.


      There must be a better way! Maybe there's some magic syntax in the wildfly config files that I'm not aware of, that lets you reference environment variables?



      Michael Davis