Loading secrets from .env in the development environment #57
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR will resolve #10
Setting environment variables at build-time
We have variables baked into the dev container that aren't secrets at build-time. They are available for anyone to consume and leverage within their development container. Think of the environment configuration that one might need to have something work as they anticipate but doesn't provide any tangible sensitive information away.
Setting environment variables at run-time
We're specifying to the development container to pull environment variables set on the host's machine and pulling them on the fly for the container to use. For instance, we could think of API key, database credentials or tokens of any kind.
Such as doing something akin to this in the
devcontainer.json
Values are passed down to the container at runtime instead of build time. The container will only receive these values at the moment it starts. This ensures that they're not written in any of the container's layers and kept out of source control through the .gitignore., making it harder for malicious users to extract secrets from the setup.
This is just for the development environment. We would need a more robust system for the production environment to handle secrets and pull the information from that location.