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

Support envsubst to generate .env files from the actual environment #28

Closed
sazzer opened this issue Jun 4, 2020 · 3 comments
Closed

Comments

@sazzer
Copy link

sazzer commented Jun 4, 2020

The envsubst tool is available in the container already, and can be leveraged to automatically generate the .env files from environment variables passed in to the Docker container at runtime. This in turn can make things really flexible for configuring the running app by simply changing the runtime environment without needing to change the files inside the container in any way.

@sazzer
Copy link
Author

sazzer commented Jun 4, 2020

I have since realised that this form of expansion already happens using any environment variables of the form REACT_APP_*, so it's not strictly needed to do something like this.

However, this can allow for more complicated expansions, such as interpolating values from the Docker environment into a single value for the webapp.

I do have a PR I'll put up for this in case there is interest and leave it up to you :)

@andrewmclagan
Copy link
Owner

YEP! this now works see the updated docs for 3.x.x

@nick4fake
Copy link

@andrewmclagan Not sure where is it noted in the docs. Could you please share a link?

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

No branches or pull requests

3 participants