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
Enable passing config via environment variables #2
Enable passing config via environment variables #2
Conversation
This simplifies deployment in various environments and it is generally considered the best practice.
629234d
to
de26240
Compare
Hi @oxarbitrage, can I help you in any way to push this through faster? I'd like to continue improving the codebase and fixing bugs, and don't want create many PRs at the same time - that would only make merging harder. Also, when this is merged it'll be easier to reproduce any bugs reported subsequently. Thanks. |
yes, thanks for what you do, i am having some problems with my internet this week and that is having me behind. i only have available a very slow connection at the moment. i am also taking some vacations starting tomorrow and ill be back monday 22th. your contributions all look good so i am going to merge them now but keep the current version running to the explorer because i don't want any issue while traveling that i may not be able to fix. let me ask you something so when i came back i can upgrade the service to the last version with your additions. i run the api service as follows:
in a how the files that are under cron will have the environment variables, if i have them added to the user for running the service then cron will have them available ? thank you very much for your work. |
[Waiting #2] Dockerize the API service including background tasks
Thanks for fast response. The new feature for passing configuration through environment variables is made backwards-compatible, so if you used the values as defined in the code, you'll be just fine even after this is merged and don't have to do any further changes. If, however, you maintain a different version of the repo for production where you have those connection parameters overridden (changed to different values), then you'll have to put these values into environment variables and make them available to the process. There are multiple ways to do it, the simplest one is just to define them on the shell line, e.g.:
Likewise you'll have to change the crontab entries (put the env variables before the command). There are other ways to make your env variables automatically available to your processes but those depend on your OS. For example, in Ubunut you can add them all to For now you can keep using your existing I suppose you're using nginx as a front server on production right now, is that right? So far I configured the Docker Compose to use uWSGI only (in HTTP mode), but I can integrate nginx as well if you want. Or, alternatively, you can keep your nginx outside of Docker and just set it to reverse-proxy all connections back to Docker-powered uWSGI process. We can discuss this later if you're interested. |
thank you for that, i use the exact same values for production so ill give it a try as i see they are in the code by default so i will be fine. ill check into the docker when i came back. in regards to nginx, yes i use it in production, the configuration file is as follows:
mainly use it because the service was not able to handle the high traffic without it, i am pretty new to nginx and uwsgi itself so there are some things i am not totally sure of but with that configuration the services almost don't ever crash anymore. I used the same for other wrappers that you maybe already saw: They are all working fine with a similar configuration of wsgi and nginx. Your contributions are helping to put this services into the bitshares organization repos, thats is the goal, if we can do that i can also get funding for your contributions, not my decision alone but definitely can happen. anyways, we might discuss that if you are interested in telegram or by email. thanks again. |
I'll send you a PM on Bitshares Talk, we can set up a communication channel then. |
This simplifies deployment in various environments and it is generally
considered the best practice.