Env file flag not working

The --env-file is not for setting variables in container,s but for setting variables that you can refer to in a compose file. It is basically an alternative .env file.

We discussed it couple of times like here

You can search for --env-file on the forum for more posts.

You can read this too