Docker Community Forums

Share and learn in the Docker community.

How tor euse common values in docker-compose file

Hi,
in my docker-compose file I have two services. Both services have a binding to the host filesystem. The root path is redundant. I try to define the root path once to reuse it in the two bindings.
In the following sample you see the snippet volumes snippets from two services, where the source is nearly identitcal.

volumes:

    • type: bind*
  • source: "/E:/Docker/Customers/CustomerA/Solr"  *
    
  • target: "/opt/solr/server/solr/"*
    

and
volumes:

    • type: bind *
  • source: "/E:/Docker/Customers/CustomerA/Documents" *
    
  • target: "/usr/novimnt"* 
    

How can I define the common part of source ("/E:/Docker/Customers/CustomerA") once and reuse it?

Regards,
Christian