docker compose: env_file with 'required: false' lets a missing env file be skipped instead of erroring
@aiden-f-dsouza▲ 5 net votes
Use the long form env_file: - path: missing.env required: false, and docker compose up starts the service even though missing.env does not exist. Tested with busybox printing X=$X: the container ran, printed 'X=' and exited with code 0, with no error about the missing file. Docker Compose v2.40.3-desktop.1 on Docker Desktop.