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

Docker image build and push failing #15

Open
jpdom opened this issue Nov 16, 2020 · 14 comments
Open

Docker image build and push failing #15

jpdom opened this issue Nov 16, 2020 · 14 comments

Comments

@jpdom
Copy link

jpdom commented Nov 16, 2020

The automatic action to build and push the docker image to the docker repository is failing.

@ashalliants
Copy link

The dockerfile from the fork doesnt actually work - took me a while but did eventually manage to get it running in headless mode for docker - but can confirm, was a giant ballache

@ok24601
Copy link
Owner

ok24601 commented Dec 29, 2020

Cool, great job.I tried to make it work but failed. Would you share your solution for headless mode?

@ashalliants
Copy link

ashalliants commented Dec 29, 2020

I did tweak some stuff in the actual code but I don't think its needed, but let me know if this bombs out for you

FROM markhobson/maven-chrome:jdk-11
RUN apt update && apt install -y xvfb/stable google-chrome-stable

WORKDIR /artifact/app
COPY . .
RUN ./gradlew build

EXPOSE 8088
CMD xvfb-run -l -a -e /dev/stdout java -jar /artifact/app/build/libs/etoro-api-0.1.3.jar

Note that you'll need to run it with extra space given to shm when running it, so something like this:
docker run --shm-size=1g -p 8088:8088 -e LOGIN=xxx -e PASSWORD=xxx etoro-api

@ashalliants
Copy link

whilst you're here actually, do you know what I'm doing wrong with opening positions? literally everything bombs out saying it couldnt find the asset with ID xxx when making a buy order on demo

@ashalliants
Copy link

heres using the demo code from the readme (same result in swagger ui, even with profit and stop loss enabled)

image

Note it must be doing something as its always able to resolve the name to an asset ID

@ok24601
Copy link
Owner

ok24601 commented Dec 29, 2020

Hi, you probably didn‘t added asset to your whatchlist, try to remove whatchlist.json and do again

@ashalliants
Copy link

Perfect, sorry I'm an idiot who didn't read the readme properly! Many thanks! Only remaining question is can you set a takeprofit / set a stop loss based on percentage like in the real api, ie take profit of 5% - or do you need to calculate the TL rate manually? Promise I checked the docs first this time :)

@ashalliants
Copy link

and I guess for bonus points, is there a way to place an order rather than 'at market'? - might even be worth opening up a proxy that u can just jam requests at and it adds the necessary headers. happy to offer some help making any of this possible if it isnt already :)

@ok24601
Copy link
Owner

ok24601 commented Dec 30, 2020

hi,
at the moment you can only set SL or TP ("takeProfitRate" or "stopLossRate") as a price and not in %, it's possible to rebuild this logic you can modify method "openPosition()" in EtoroHttpClient class

about place order API I don't have this at the time, you can try to implement it just like openPosition method. But first you have to find out which REST API etoro uses for that.

@JustinGuese
Copy link

Hey @ashalliants, I tried to copy your dockerfile, but it fails for me... does it still work for you even with the newest Chrome? I feel like the newest chrome broke it

@ashalliants
Copy link

ashalliants commented Feb 1, 2021 via email

@JustinGuese
Copy link

I mean you can try just using an older version of the chrome image then, but it's been 100% working for me and I truly like in the last couple of weeks. Make sure you use the shg param or whatever it is. (Sorry I'm not at my computer right now)

On Mon, 1 Feb 2021, 8:54 am Justin Güse, @.***> wrote: Hey @ashalliants https://github.com/ashalliants, I tried to copy your dockerfile, but it fails for me... does it still work for you even with the newest Chrome? I feel like the newest chrome broke it — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#15 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHP3JGSS6S47OK4K5VVPA5LS4ZT5HANCNFSM4TXDLYUA .

Alright, thanks! I will try around and post it here if I have a solution!

@JustinGuese
Copy link

Alright, with a little tweaking I got it to work and published the image to dockerhub:
https://hub.docker.com/repository/docker/guestros/etoroapi

@ashalliants
Copy link

ashalliants commented Feb 1, 2021 via email

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

4 participants