dev: Reorganize and document the env files #917
Merged
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.
Context
While working on #916, I've realized that I could greatly improve the handling of environment variables in the application, especially to avoid the weird
default:
env var processor. The idea was to declare all the "production" environment variables in the.env
file.Then, I wasn't happy with the default values being those for the development environment. The
.env
variables are now suitable for production. The only exception is theAPP_ENV
variable which is set todev
in order to ease the workflow in development.The development variables are now declared in a
.env.dev
file. This implied to copy some of them in the.env.test
as well.The consequences are:
APP_SECRET
,DATABASE_URL
,MAILER_DSN
, etc..env.dev.local
file (.env.local
doesn't work anymore to override e.g.DATABASE_URL
)I've also reorganized the environment variables in the env files, added documentation to explain how to manage these files, and put all the strings between strings.
This PR must be merged after the release of Bileto 0.14.0 to give me time to fix potential bugs due to these changes.
I want to test these changes with the prod Docker image too.
Related issue(s)
N/A
How to test manually
Reviewer checklist