Opt-in/out for .env being written
#5582
Replies: 1 comment
-
|
imo coolify should not inject the .env file at all when building an image. In certain circumstances, you can even end up exposing it if using static site. This is also one of the long standing issues with nixpacks preview build args, where for preview builds it doesn't create a .env file but a .env.pr-x file which no framework will read. There is a series of mistakes when dealing with env: Currently when building an image, the .env is added to the cloned repo, before docker build is ran, however this isn't needed at all, since all build args are passed in on the cli. for runtime, the .env file is also saved in the configuration directory and just passed in with the compose file so they get correctly interpolated and added to the environment tldr I personally would never have a .env in a repo since it would not be part of the final build, unless you specifically copy it over |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Previously discussed on discord
When you deploy an application coolify writes a
.envfile.In some frameworks the
.envfile is used as defaults environment variables, which should be commited and for those that should not be committed you can use.env.local. (how nextjs handles .env)My problem is that coolify OVERWRITES the
.envfile, which broke my application.I think it should be opt-in to have the
.envfile written as no other docker platforms have this behavior.Additionally it would make sense to choose where the
.envfile is written to, it might not always be in the root directory and it could also be.env.localthat you wanted to be written.Beta Was this translation helpful? Give feedback.
All reactions