Terminal cannot read the contents of the .env file
Closed this issue · 2 comments
When I run a command in the terminal, it ignores the variables linked to the .env file.
For example, in the "Run Postgres" command given in op-be-docs (docker run -d --expose 5432 -p 5432:5432 --network op --name postgres -e POSTGRES_USER={POSTGRES_USERNAME} -e POSTGRES_PASSWORD={POSTGRES_PASSWORD} -e POSTGRES_DB=op postgres
), even though there is a corresponding value in my .env file for the expression POSTGRES_USER={POSTGRES_USERNAME}
, it cannot retrieve this value and accepts the username as {POSTGRES_USERNAME}
.
It is created as an issue.
Typically, when a program runs in the terminal, we expect the environment file to define variables for the current session. The fact that our docker command doesn't recognize this behavior sparked our curiosity, prompting us to discuss it as a team. We wanted to figure out how to properly and efficiently set the .env file for the current session in both Linux and Windows terminal environments.