Ha "config.env" helyett ".env" -nek hívod, akkor elvileg nem kell a --env-file, lásd fentebb, bár csak elivleg, mert egyrészt ezt mondja:
You can set default values for environment variables using a
.envfile, which Compose automatically looks for in project directory (parent folder of your Compose file). Values set in the shell environment override those set in the.envfile.
később meg ezt:
You can set default values for any environment variables referenced in the Compose file, or used to configure Compose, in an environment file named
.env. The.envfile path is as follows:
- Starting from
v1.28, the.envfile is placed at the base of the project directory.- Project directory can be explicitly defined with the
--fileoption orCOMPOSE_FILEenvironment variable. Otherwise, it is the current working directory where thedocker composecommand is executed (v1.28).- For versions older than
v1.28, it might have trouble resolving.envfile with--fileorCOMPOSE_FILE. To work around it, it is recommended to use--project-directory, which overrides the path for the.envfile. This inconsistency is addressed inv1.28by limiting the file path to the project directory.
kiemelések tőlem, szóval vagy a docker-compose.yml könyvtára, vagy a $PWD, ahol a .env-et keresi. Sajna az utóbbira tippelnék, mert szerintem csak az elején írtak faszságot, de ki tudja, hátha.