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

[Feature]: Read environment variables from environment with inheritance in docker container #9226

Closed
1 task done
PatrickHuetter opened this issue Nov 17, 2021 · 14 comments
Closed
1 task done
Assignees
Labels
Enhancement New feature or request New Developers Pod Issues that new developers face while exploring the IDE

Comments

@PatrickHuetter
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Summary

I'm using the docker image to deploy appsmith within a Kubernetes cluster. The problem I have is that it doesn't seem to be possible to set the email/smtp settings using environment variables because the docker container will always use the variables from docker.env file within the filesystem.

It would be nice if there would be some inheritance where the OS/shell environment variables that can be injected via dockers default way that take highest priority.

I don't know wether you use spring or spring boot but this is also default behavior in spring boot. You can overwrite every configuration directive by the same name as environment variable.

Why should this be worked on?

With this it would be more easy to deploy locally via docker and also to use Kubernetes pods without using a ConfigMap.

@Nikhil-Nandagopal
Copy link
Contributor

Nikhil-Nandagopal commented Nov 18, 2021

@PatrickHuetter thank you for the feature request this is an interesting idea. We'll evaluate it and try to have it prioritised!

@github-actions github-actions bot added New Developers Pod Issues that new developers face while exploring the IDE Platform Pod labels Nov 18, 2021
@holyachon
Copy link

This feature is also required to deploy appsmith to AWS ECS.

@grinono
Copy link

grinono commented Jan 17, 2022

I have the same issue for ECS deployment

@bradwood
Copy link

bradwood commented Jan 17, 2022

I have the same issue for ECS deployment

same! looking forward to this too -- see https://12factor.net/config also for best practices here -- loading an environment config from a file is generally an antipattern for containerised services...

@bradwood
Copy link

bradwood commented Jan 22, 2022

Just to add to this, an environment variable should be read from the environment of the process/container and NOT from a file. Naming a file as something.env is completely wrong, as this file is really now a config file which should be something like an ini, toml, yaml or json file.

Environment variables should ONLY be read from the environment as the name suggests and they should override any setting provided by any kind of config file.

@pranavkanade
Copy link
Contributor

pranavkanade commented Jan 24, 2022

Screenshot 2022-01-24 at 4 28 34 PM

Little more push for this feature.

@marcoacierno
Copy link

Does anyone here have any workaround for this?

@bradwood
Copy link

bradwood commented Jan 25, 2022

You can probably fix this by creating your own docker container FROM this one and then wrapping the ENTRYPOINT with a shell script that takes the environment variables and writes out the config.env before starting the process... You could do this with a template file and the envsubst command in Linux (Docker) shell script in 3/4 lines of bash I expect. But it's pretty hacky.

@areyabhishek
Copy link
Contributor

Hi everyone, I have an update on this issue. We are just meeting a fix into release today and expect to have the fix live in production next week. Unfortunately COVID took a toll on our team and we've been recovering the past few weeks.

@funge
Copy link

funge commented Feb 7, 2022

Any update on this one? Thanks

@sharat87
Copy link
Member

sharat87 commented Feb 9, 2022

Hey, this was fixed as part of #10157. Please try it out and let us know if you face any further problems. Thanks!

@sharat87 sharat87 closed this as completed Feb 9, 2022
@SelaOZ
Copy link

SelaOZ commented Apr 2, 2024

@bradwood Do you have that script by any chance?

We need this to load different environments for local, stage and prod and it would be very helpful.

@bradwood
Copy link

bradwood commented Apr 2, 2024

sorry. I don't -- I've moved on since this was on my radar and I don't use appsmith

@Nikhil-Nandagopal
Copy link
Contributor

@bradwood was this the only reason why you moved on? I'd love to get some of your time top learn about your experience with the platform
https://calendly.com/appsmith-nikhil/30min

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request New Developers Pod Issues that new developers face while exploring the IDE
Projects
None yet
Development

No branches or pull requests