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

Environment / Settings Configuration Standardization & Docker Tweaks #257

Open
sokkit-io opened this issue Apr 9, 2024 · 1 comment
Open

Comments

@sokkit-io
Copy link
Contributor

After updating my fork with the current state of the new branch, I realized the docker composition I added about a year ago no longer ran properly when following the instructions from the Docker section of the readme. Reason being, it appears the dotenv credentials loader I originally added to the echo_bot example has been replaced with a different yaml based loader pointed at examples/creds.yaml.

Notes:

  • After moving my creds from the previous .env file to examples/creds.yaml and slightly tweaking the Dockerfile, the example echo_bot works fine again when running via docker compose. No biggie.
  • It appears examples/creds.yaml is a VCS tracked file (not .gitignore'd), meaning that consumers of this API can easily make the mistake of checking in their credentials to source control for the world to see if they add their creds to the file and commit all local changes. This is why I had an .example.env file and the copy command in the readme as well as a dotenv .gitignore rule in my original docker PR.

I'm opening this issue just to gauge interest / opinions / preferences around standardizing the configuration of environment variables and settings such as client credentials for this project going forward. I personally don't have a strong preference as either approach seems to work, but certainly the readme will need to be updated and we should encourage consumers of the API to create a non-VCS tracked (.gitignore'd) copy of examples/creds.yaml if it's decided to stick with yaml based configuration.

I don't mind opening a PR containing suggested changes if yaml based configuration is chosen as the standard. If you'd like to tinker with this yourself using the echo_bot example or if you're just here trying to get your docker composition working again:

  1. Add your creds to examples/creds.yaml (DO NOT COMMIT THESE CHANGES)
  2. Make the following changes to the Dockerfile:
FROM python:3.8

LABEL name="kik-bot-api-unofficial"

WORKDIR /app

-COPY setup* /app/
+COPY . /app

RUN pip install /app

-COPY . /app
COPY examples/echo_bot.py /app/bot.py

CMD python bot.py
  1. Run docker compose up --build from the root of the repository
@tomer8007
Copy link
Owner

Thank you for noting this. The YAML stuff are due to @karlebot 's changes (#228).

I don't mind opening a PR containing suggested changes if yaml based configuration is chosen as the standard

I'm fine with this. Perhaps @karlebot wil have something to say,

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

2 participants