stackoverflow.com
I'm new to Docker. I am writing a docker-compose file which creates 2 containers, foo and bar, sharing a volume data: services: foo: container_name: foo build: ./foo volumes: - data:/var/lib/ bar: container_name: bar build: ./bar volumes: - data:/var/lib/ depends_on: - foo volumes: data: Now, I want to use the environment variable TAG, to tag containers and volumes, in order to specify if it's for test or production.
https://stackoverflow.com/questions/42952855/env-file-named-volume-in-docker-compose