Variables in Docker Compose

preview_player
Показать описание


Рекомендации по теме
Комментарии
Автор

Thank you.
On windows you can SET an environment variable which matches the name in the compose file. Docker will complain if you attempt to set it as a prefix to the docker-compose command.

cheekybirdierichard
Автор

Thank you for tutorials. What is the terminal are you using? 👍

eibrahimov
Автор

@0:17, "ports" variable is defined. There is a dash "-" in front of 80:80. However, I have seen docker compose files that declare variables without the dash in front. Same goes for "volumes" variable...
Is dash necessary in compose? Is there a difference in requirement for the dash between compose Version 2.x and 3.x?
Extension to this "dash" question.
In your "environment" variable section, there is no dash in front of MYSQL_ROOT_PASSWORD, ...

So, does it mean that "dash" should not be use in "environment"?
Also, if there are multiple entries for a variable, say "volumes", should we start each line (e.g. in your - cachedata:/data) with a dash up front?

sorcererstone
Автор

Good tutorial, but I have a question, Why in my Linux a .env created file is not saved in the folder? It's as if it dissapeared or is hidden, I couldn't find that anymore. Can you tell me why?
Thanks for all, liked and subscribed

grantolosi