maxbbraun / trump2cash

A stock trading bot powered by Trump tweets
https://trump2cash.biz
MIT License
6.25k stars 855 forks source link

Build it as a docker image #23

Open zhenyulin opened 7 years ago

zhenyulin commented 7 years ago

This will help shorten the setup process.

Also currently I'm getting some errors during dependency installation as following

/usr/bin/ld: cannot find -lz

collect2: error: ld returned 1 exit status

error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
zhenyulin commented 7 years ago

the GCC version I'm using is gcc (Debian 4.9.2-10) 4.9.2

zhenyulin commented 7 years ago

OK, the build issue resolved when I use Python3. Still would be great to package it as a docker image.

petschni commented 7 years ago

@zhenyulin were you able to create a working docker image?

kylelee715 commented 7 years ago

@zhenyulin I'm running into the same issue on the dependencies, could you share further what you did to get it working?

zhenyulin commented 7 years ago

@kylelee715 I fixed my issue running installation with Python3, hth

dustMason commented 7 years ago

@zhenyulin please submit your dockerfile in a PR!

zhenyulin commented 7 years ago

Let me have a look at creating a docker image for this later, will post it here when done.

dustMason commented 7 years ago

I'm not a very experienced pythonista, but I think this is written for python 2.x, not python 3. This one-liner Dockerfile successfully builds and runs:

FROM python:2-onbuild

Just put that line into a Dockerfile in the same dir, then build it with docker build . -t trump2cash. Then you can run any of the scripts like so: docker run trump2cash python benchmark.py.

Note that you will need to supply all the env vars somehow. Docker compose and a .env file or command line args would both work.