Get env vars from .env file#554
Conversation
|
Some alternatives to this approach would be:
|
| - BOT_ADMIN_ROLE_ID | ||
| - CHANNEL_DEVLOG | ||
| - CHANNEL_COMMUNITY_BOT_COMMANDS | ||
| - REDIS_HOST=redis |
There was a problem hiding this comment.
If this doesn't already have a default value set in Python then it should. Alternatively, the default can remain in the compose file but I prefer defining it in Python.
There was a problem hiding this comment.
The default is currently set to redis.default.svc.cluster.local
Line 278 in c6353a8
There was a problem hiding this comment.
Okay, that's the production host and it should stay that way. Therefore, it's best to leave it set to redis within the compose file since it can spin up a redis container. If running without Docker Compose, I presume users are already told they have to manually enable fakeredis?
There was a problem hiding this comment.
I've added the default back in.
They are, but it's a little buried in the lancebot wiki atm https://pythondiscord.com/pages/contributing/sir-lancebot/sir-lancebot-env-var-reference/
I'm planning on drafting a guide to be added onto the wiki for the docker setup (As it's not currently documented).
HassanAbouelela
left a comment
There was a problem hiding this comment.
LGTM, thanks for updating this.
Description
Removed explicit mentioned of env vars from docker compose, replaced with an env_file
Reasoning
This means users of the docker-compose workflow won't need to worry about accidentally commiting their docker-compose file which contains all their secrets!
This will pull all of the env vars from the .env file in the project root dir
See this chat for context.
Additional Details
Before merging we should:
Did you:
pipenv lock?pipenv run lint)?