title: Docker-compose, conditional statements? (e.g. add volume only if condition)
body: <p>I want to add a volume to my service, but only if the final user gave a folder for it. Otherwise, no volume should be mounted, for the already-prepared image has valid data in a default folder.</p>
  <p>That is, I want to do something like (pseudocode):</p>
  <pre><code>services:
  
    my_awesome_service:
    
      volumes:
        if ${VARIABLE} =&gt; ${VARIABLE}:/app/folder
  </code></pre>
  <p><strong>Are such conditional statements definable in a docker-compose file?</strong></p>
  <p>The only way I see to make this possible is to first define a base docker-compose file, which does not have the volume mount, and the call on a second docker-compose file only if the <code>$VARIABLE</code> is defined. This is fine for a single or few conditions, but gets nasty if there are many.</p>
  <p>Any solution?</p>