Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I believe docker is less functional because SHELL variables take precedence over .env files or --env-file #5093

Open
david-zamora-minderest opened this issue May 29, 2024 · 2 comments

Comments

@david-zamora-minderest
Copy link

david-zamora-minderest commented May 29, 2024

Description

First of all I want to say that I may not be aware of every way to deal with this problem, but as far as I've seen it makes no sense to me.
I have just switched to the new docker compose command to find out, that the precedence of environment files changed around a couple of years ago. I have a docker-compose.yml that expect a DENO_PORT environment variable from the .env file to start a Deno app inside the container using the ports 5000:5000. Now, while I am updating the application locally, I need to start the same app in a different port with live reloading. The Application is expecting to get the port from the environment variable DENO_PORT, so... If I set DENO_PORT to 5001 in zshrc and to 5000 in the .env file, it doesn't work anymore. Now it's always the port 5001, I can't have the same variable with different values between my host and my containers, how is that a good idea? Why is it a good practice to have exactly the same?

How is it possible that now I need two variables to accomplish the same thing? Is there something I am missing? How is this better for other user cases?

@MishkaMN
Copy link

MishkaMN commented Jun 18, 2024

I am also facing similar issue as well. Can someone please explain how I can override the shell variables from HOST in the container gracefully with .env files

@david-zamora-minderest
Copy link
Author

@MishkaMN it seems to me, that you can't anymore. Since your own host environment variables override those in the container.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants