I would like to be able to use env variables inside docker-compose.yml, with values passed in at the time of docker-compose up. This is the example.
docker-compose up
I am
Since 1.25.4, docker-compose supports the option --env-file that enables you to specify a file containing variables.
--env-file
Yours should look like this:
hostname=my-host-name
And the command:
docker-compose --env-file /path/to/my-env-file config