How to update configuration file (.env file) while running docker container

You can add a directory to the docker using -v

docker run -v /Path/To/The/Env/file:/env-file-directory -p ...

Then target the file in the linked directory inside of your docker using the name /env-file-directory