-
Notifications
You must be signed in to change notification settings - Fork 3
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
Readme file updated along with other validations #42
Readme file updated along with other validations #42
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@@ -11,28 +11,29 @@ class DBSettings(BaseSettings): | |||
DB_PASSWORD: str | |||
|
|||
class Config: | |||
env_file = ".env" | |||
env_file = ".env.local" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how will it behave with .env.docker file Add a comment here please
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, I researched a bit and found out that each env file is unique.
And so by the previous '.env', your docker wouldn't work cause if you'll check your compose file it is .env.${environment_name} now in any case it will never be .env and docker won't work and so I've standardized it and fixed your docker error too.
Here's you can repro the uniqueness,
change your .env file to .env.local in your current code and run it.
Also there is a hierarchy of it:
Here's the priority of the files for the development build and the production build:
Dev.: (npm start): .env.development.local, .env.local, .env.development, .env
Prod.: (npm run build): .env.production.local, .env.local, .env.production, .env
And so by this .env.local is pretty standard and solves your compose problem too
ALLOWED_HOSTS: list = ["*"] | ||
CACHE_MAX_AGE: int = 60 | ||
|
||
class Config: | ||
env_file = ".env" | ||
env_file = ".env.local" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
compose.yaml
Outdated
@@ -45,14 +45,12 @@ services: | |||
restart: always | |||
container_name: fast-api-app | |||
env_file: | |||
- ./.env.${ENVIRONMENT_NAME} | |||
- ./.env.local |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
revert it as it is dynamically get injected with active environment variable
compose.yaml
Outdated
@@ -62,7 +60,7 @@ services: | |||
dockerfile: Dockerfile | |||
command: ['celery', '-A', 'app.app.celery', 'worker', '-l', 'info'] | |||
env_file: | |||
- .env.${ENVIRONMENT_NAME} | |||
- .env.local |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as previous
.env.example
Outdated
SENTRY_ENABLED= | ||
SLACK_ENABLED= | ||
# Advance Usage - Docker Configuration | ||
DB_ROOT_PASSWORD= |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please move it to belkow line 7 so that all db config get together
@@ -11,28 +11,29 @@ class DBSettings(BaseSettings): | |||
DB_PASSWORD: str | |||
|
|||
class Config: | |||
env_file = ".env" | |||
env_file = ".env.local" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dont harcode. .env.local keep it .env.${environment_name} i mean to say this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, for it take the environment name it has to go to .env file and for it to go to environment file it has to know the .env file.
It's not gonna work as it's a circular thing. We can have some sort of hack here tho but that's not gonna remain a standard base file
Also please go through the hierarchy pattern I've mentioned.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reference link please
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ticket Link
Related Links
Description
Readme file has been updated as more user-beginner friendly to get started with the template.
Environment variables check added on server startup
Removed unnecessary requirement in requirements.txt for faster setup for end user.
Fixed opentelemetry warning while running server
Steps to Reproduce / Test
Checklist
pytest
passesGIF's