( kroozo | 2022. 11. 29., k – 16:55 )

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 .env file, 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 .env file.

 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 .env file path is as follows:

  • Starting from v1.28, the .env file is placed at the base of the project directory.
  • Project directory can be explicitly defined with the --file option or COMPOSE_FILE environment variable. Otherwise, it is the current working directory where the docker compose command is executed (v1.28).
  • For versions older than v1.28, it might have trouble resolving .env file with --file or COMPOSE_FILE. To work around it, it is recommended to use --project-directory, which overrides the path for the .env file. This inconsistency is addressed in v1.28 by 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.