Docker-compose, conditional statements? (e.g. add volume only if condition)
问题 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. That is, I want to do something like (pseudocode): services: my_awesome_service: volumes: if ${VARIABLE} => ${VARIABLE}:/app/folder Are such conditional statements definable in a docker-compose file? The only way I see to make this possible is to first define a base docker-compose file, which does not