-
Is it possible to put the environment variables in some kind of file instead of using docker compose or a giant docker run command? |
Beta Was this translation helpful? Give feedback.
Answered by
itzg
Nov 13, 2023
Replies: 1 comment 1 reply
-
Yes it is. With a compose project, a With https://docs.docker.com/engine/reference/commandline/run/#env |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
nmills3
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes it is. With a compose project, a
.env
file is automatically included if present or can be explicitly referenced:https://docs.docker.com/compose/environment-variables/set-environment-variables/#substitute-with-an-env-file
With
docker run
you can reference env files with--env-file
:https://docs.docker.com/engine/reference/commandline/run/#env