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
[python] Implementing ability to run bot in a docker container #7
Conversation
This PR is in accordance to Issue #3 |
@lorcalhost If there's some changes to be made, please ping me :) |
Thanks @NovusEdge , I'll test it right away and let you know ASAP |
|
||
FROM python:3 | ||
|
||
WORKDIR ./ |
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.
This may break if the script is run from a directory other than the project-directory.
A solution to this may be using os
and pathlib
to change the path to the project-directory.
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.
@lorcalhost
Please let me know if you want me to make the changes according to the before-mentioned comment.
PS: Please make it into a separate issue so that it's easier to review and edit
@NovusEdge I am having some trouble running the Docker image (probably due to my lack of knowledge on Docker images). Would you mind updating the Also, in your testing were you able to use all functionalities without any problem? Edit: never mind, all seems to be working fine on my end, did you encounter any problems? |
@lorcalhost I believe the problem may be because of what i mentioned in one of the comments:
|
sure :) |
When you say project-directory do you mean from inside the |
No, I did not, not in any of my tests, although I would admit, I was kinda stuck with this in the beginning:
|
the |
@NovusEdge Actually one problem does arise, currently the $(which python3) -m binance_trade_bot & If with Docker we are working from a different directory than the One way would be calling BTBManagerTelegram(root_path='../binance-trade-bot') but in this case we would require both the What else do you propose? |
@lorcalhost |
@NovusEdge sent you a friend request on Discord, unable to send you messages because we don't share a server. |
Changed the
BTBManagerTelegram.py
to make it so that a--docker
flag can be passed in, which will allow the script to run in a docker containerThe container is:
python:3
and uses theDockerfile
to make a temporary image in which the script will be run.So, to normally run the script:
And to run inside a docker container: